MATLAB Answers

Even Numbers in a matrix a

15 views (last 30 days)
Nicholas Cappellino
Nicholas Cappellino on 31 Oct 2018
Commented: madhan ravi on 31 Oct 2018
I have a matrix 1 through 20 and i need to make a new matrix b with even numbers 1 through 20

  0 Comments

Sign in to comment.

Answers (1)

madhan ravi
madhan ravi on 31 Oct 2018
Edited: madhan ravi on 31 Oct 2018
a=1:20
b=a(rem(a,2)==0)

  4 Comments

Show 1 older comment
Nicholas Cappellino
Nicholas Cappellino on 31 Oct 2018
so a=1:20 how do i define b to equal the even numbers of a
madhan ravi
madhan ravi on 31 Oct 2018
See edited answer
madhan ravi
madhan ravi on 31 Oct 2018
If you got the answer to your question make sure to accept the answer so people know question is solved else let know

Sign in to comment.