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 Center および File ExchangeLogical についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by