MATLAB: The elements of a mxn matrix are the results of m*n matrices. how to do it

matrix

Hi. I have a situation where i have to generate a 6×6 matrix in which each element of the matrix is a result of 36 different matrices. i used the following code to generate the 6×6 matrix. matrix_11=[…]; matrix_12=[…]; . . . matrix_66=[…]; for i=1:6 for j=1:6 w(i,j)=matrix_??? end end My problem is how to call each of the matrix separately in w for every value of i and j. pls help cyberguys.

Best Answer

w = cell(6);
for i1 = 1:6
for j1 = 1:6
w{i1,j1} = eval(sprintf('matrix_%d%d',i1,j1));
end
end