How do I add 1 to all even numbers and add 3 to all odd numbers in a vector?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
EiGi
el 3 de Oct. de 2016
Respondida: michael
el 3 de Oct. de 2016
I have no idea how to do this.I already created a vector by typing: vec = round(-10 + 35* rand(1,30)); and next I am suppose to add 1 to all the even numbers and add 3 to all odd numbers. Thank you in advance for the help.
0 comentarios
Respuesta aceptada
Más respuestas (1)
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!