how to store more than one list into one list or one file to be includes all generated list from a loop ????
1 view (last 30 days)
Show older comments
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...
Accepted Answer
Walter Roberson
on 19 Jun 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 Comments
More Answers (0)
See Also
Categories
Find more on Loops and Conditional Statements in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!