Write a MATLAB code for this problem. Write a function called trio that takes two positive integer inputs n and m. The function returns a 3n- by - m matrix called T. The top third of T (an n by m submatrix) is all 1s, the middle third is all 2-s while the bottom third is all 3-s.
Answers
Answered by
0
Answer:
hey good morning have a great day
please follow me
Answered by
0
Answer:
function M = trio(n,m)
a=ones(n,m);
b=2*a;
c=3*a;
M=[a;b;c];
end
Explanation:
first make matrix of order n*m containing only 1. then multiply it with 2 and 3 respectively so that we get matrices containing all the 2's and 3's . then simply arrange these 3 matrices.
Similar questions