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
belongs to book: MATLAB: A Practical Introduction to Programming and Problem Solving|Stormy Attaway|Fourth Edition| Chapter number:2| Question number:23.2
All Answers
total answers (1)
>> 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