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

1 vue (au cours des 30 derniers jours)
suchismita
suchismita le 10 Août 2015
Modifié(e) : Stephen23 le 10 Août 2015
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.

Réponse acceptée

Stephen23
Stephen23 le 10 Août 2015
Modifié(e) : Stephen23 le 10 Août 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:

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by