For loop store variable with different dimension
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Rick Verberne
el 17 de Mzo. de 2018
Comentada: Rick Verberne
el 19 de Mzo. de 2018
Hi all,
I have a question about storing the results from a for loop. The problem is that each round results in a vector of different size. I thought creating an cell should work, but I'm clearly (doing something) wrong. Other option, maybe? would be to fill the "empty" places in the matrix with zeros.
Best,
Rick
0 comentarios
Respuesta aceptada
Von Duesenberg
el 17 de Mzo. de 2018
A cell should work fine:
C = cell(2,1);
C{1} = [1 2 3];
C{2} = [1 2 3 4];
Más respuestas (0)
Ver también
Categorías
Más información sobre Loops and Conditional Statements en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!