I have a 3-Dimensional matrix K(i,j,l)
. I would like to create a new matrices from K, which would be a slice for each value of i. I also have to transpose the newly formed 2-D matrix.
for l=1:40
for j=1:15
K1(l,j)=K(1,j,l);
K2(l,j)=K(2,j,l);
.
.
.
K35(l,j)=K(35,j,l);
end;
end;
I want to create another loop where the names of new matrices are created within the loop.
i.e.;
K1(l,j)=K(1,j,l) (when i=1)
K2(l,j)=K(2,j,l) when i=2...
The problem that I faced is that I cannot seem to iteratively name of the matrices (K1,K2...K35) with in the loop and at the same time perform the dimension change operation. I tried num2str
, sprintf
, but they don't seem to work for some reason. If any of you have an idea, please let me know. Thanks!