how to save a matrix in a loop together whose size is changing?

1 view (last 30 days)
I have a matrix A who is changing the number of columns and rows in a loop for example,
there are 5 iterations
for i=1:5
........
........
........
end
where
A(1)=[2 3 4];
A(2)=[1 2 3 4 5
1 5 2 6 8];
A(3)=[2 1 4 5 6 7];
A(4)=[1 2 5 6 7 8
2 3 9 4 3 1];
A(5)=[1 2 3 4 5 6 7 8];
in B i want to save all the values of A.
please help me.

Accepted Answer

Stephen23
Stephen23 on 10 Aug 2015
Edited: Stephen23 on 10 Aug 2015
You could put the matrices into a cell array:
B = cell(1,5);
for k = 1:5
B{k} = A;
end
You might like to read this in addition to the link that I gave above:

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!