Even Numbers in a matrix a

18 visualizaciones (últimos 30 días)
Nicholas Cappellino
Nicholas Cappellino el 31 de Oct. de 2018
Comentada: Jonas Campos el 27 de Mayo de 2021
I have a matrix 1 through 20 and i need to make a new matrix b with even numbers 1 through 20

Respuestas (1)

madhan ravi
madhan ravi el 31 de Oct. de 2018
Editada: madhan ravi el 31 de Oct. de 2018
a=1:20
b=a(rem(a,2)==0)
  5 comentarios
madhan ravi
madhan ravi el 31 de Oct. de 2018
If you got the answer to your question make sure to accept the answer so people know question is solved else let know
Jonas Campos
Jonas Campos el 27 de Mayo de 2021
This answer works

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by