clc m = input("Enter the number of rows in the matrix"); n = input("Enter the number of columns in the matrix"); disp("Enter the first matrix"); for i = 1:m for j=1:n A(i, j) = input('\'); end end B = zeros(n, m); for i = 1:m for j=1:n B(i, j) = A(j, i); end end disp("Entered matrix is"); disp(A); disp("Transposed matrix is"); disp(B);