Given two real square matrix of order n. Get a new matrix of the elements of each column of the first matrix times elements of the corresponding rows of the second matrix. i coded using matlab but unfortunately it applys only for (3×3)matrix.what should i do so that it may apply for every kind of matrix, for example(4×4),(5×5) and more.
codes
clccleara=[1 2 3;4 5 6;7 8 9];b=[1 2 3;4 5 6;7 8 9];for i=1:length(a) for j=1:length(b) c(i,j)=a(i,j)*b(j,i) endenddisp(a);disp(b); disp(c);
Best Answer