how to store more than one list into one list or one file to be includes all generated list from a loop ????
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Jack
le 19 Juin 2015
Commenté : Walter Roberson
le 19 Juin 2015
hello every body...
i try to store generated lists in one list
here is the code:
Ylst=[];
for i=3
Y=[1*i;2;3];
Ylst(i)=Y;
end
this is the error:
In an assignment A(I) = B, the number of elements in B and I must be the same.
Can any body help to correct it please.. how to do it??
thanx in advence...
Réponse acceptée
Walter Roberson
le 19 Juin 2015
Ylst={};
for i=3
Y=[1*i;2;3];
Ylst{i}=Y;
end
However as you are using fixed length lists you should consider using a 2D array:
Ylst=[];
for i=3
Y=[1*i;2;3];
Ylst(:,i)=Y;
end
2 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements 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!