Q:

Create a 3 x 5 matrix of random integers, each in the inclusive range from -5 to 5. Get the sign of every element

0

Create a 3 x 5 matrix of random integers, each in the inclusive range from -5 to 5. Get the sign of every element. 

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

>> mat = randi([-5,5], 3,5)

mat =

 5 4 1 -1 -5

 4 4 -1 -3 0

 5 -2 1 0 4

>> sign(mat)

ans =

 1 1 1 -1 -1

 1 1 -1 -1 0

 1 -1 1 0 1

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now