Q:

Use reshape to reshape the row vector 1:4 into a 2x2 matrix; store this in a variable named mat. Next, make 2x3 copies of mat using both repelem and repmat

0

Use reshape to reshape the row vector 1:4 into a 2x2 matrix; store this in a variable named mat. Next, make 2x3 copies of mat using both repelem and repmat.

All Answers

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

>> mat = reshape(1:4,2,2)

mat =

 1 3

 2 4

>> repelem(mat,2,3)

ans =

 1 1 1 3 3 3

 1 1 1 3 3 3

 2 2 2 4 4 4

 2 2 2 4 4 4

>> repmat(mat,2,3)

ans =

 1 3 1 3 1 3

 2 4 2 4 2 4

 1 3 1 3 1 3

 2 4 2 4 2 4

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