how can i make a storage in simulation for matrix ?
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
i'm creating a simulation and the following is part of the code
for i=1:k
samples=ssvs(e,y,q,m,k)
z(i,:)=samples
end.......
note: e ,y ,q are variables and ssvs function will give a matrix of order m rows and q columnes i want z to store the results same as horzcat i mean i want z save first result then second then the next tell the simulation ends z order will be m*k rows and q columnes
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 14 Feb. 2013
Bearbeitet: Azzi Abdelmalek
am 14 Feb. 2013
z=[];
for i=1:k
samples=ssvs(e,y,q,m,k);
z=[z samples ];
end
1 Kommentar
José-Luis
am 14 Feb. 2013
That might be painfully slow if you don't preallocate. Hard to do that if you do not know the size of samples in advance or if that size is not constant.
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!