You also know that MATLAB can compute the transpose of a matrix A with the apost
ID: 1766814 • Letter: Y
Question
You also know that MATLAB can compute the transpose of a matrix A with the apostrophe. B=A’ results in B being the transpose of A.
Write your own routine to compute the transpose.
Let A = [4 3 5 1; 2 4 9 6; 3 6 4 4; 2 1 0 2]
#4. You also know that MATLAB can compute the transpose of a matrix A with the apostrophe. B-A, results in B being the transpose of A. Write your own routine to compute the transpose. Let A = [4 3 5 1; 2 496,3644; 2 102] your routine will need nested loops for m 1:4 for n 1:4 blah blah-blah blah blah end endExplanation / Answer
MATLAB CODE:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
A=[4 3 5 1;2 4 9 6;3 6 4 4;2 1 0 2]
for i=1:4;
for j=1:4;
B(i,j)=A(j,i);
end
end
disp('B')
disp(B)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
OUTPUT:
A =
4 3 5 1
2 4 9 6
3 6 4 4
2 1 0 2
B
4 2 3 2
3 4 6 1
5 9 4 0
1 6 4 2
>>
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.