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

조회 수: 1 (최근 30일)
suchismita
suchismita 2015년 8월 10일
편집: Stephen23 2015년 8월 10일
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.

채택된 답변

Stephen23
Stephen23 2015년 8월 10일
편집: Stephen23 2015년 8월 10일
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:

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by