Borrar filtros
Borrar filtros

Save in a cell array from a loop

1 visualización (últimos 30 días)
kounoupaki87
kounoupaki87 el 7 de Abr. de 2020
Editada: Walter Roberson el 15 de Abr. de 2021
For every iterration of my loop I have a 2D matrix (A), but the number of rows is different every time.
Ideally, in the end Iwould like to have a 3D matrix [(A)which is 2D x number of iterrations]. As I can't save in matrix format,
how can I save the results in a cell array? and how can I access the data fro a specific itteration?
ndays=365;
for d=1:ndays
help=[Temperature(:,d),Idx(:,d)];
idx=Idx(:,d);
tst=find(idx==6);
take=help(tst,:);
%save test in a 3D matrix [takex ndays];
end
  4 comentarios
Tommy
Tommy el 7 de Abr. de 2020
Ah that makes sense - happy to help!
Mohammed Belal Uddin
Mohammed Belal Uddin el 15 de Abr. de 2021
@Tommy, your answer helped me too. Thanks!

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by