Even Numbers in a matrix a

15 次查看(过去 30 天)
Nicholas Cappellino
Nicholas Cappellino 2018-10-31
I have a matrix 1 through 20 and i need to make a new matrix b with even numbers 1 through 20

回答(1 个)

madhan ravi
madhan ravi 2018-10-31
编辑:madhan ravi 2018-10-31
a=1:20
b=a(rem(a,2)==0)
  5 个评论
madhan ravi
madhan ravi 2018-10-31
If you got the answer to your question make sure to accept the answer so people know question is solved else let know

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 MATLAB 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by