Creating Dynamic variables for future use
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hi.
I need to create variables for future use in a loop. For example, for i=1,2,...n, I need to save D1, D2,...,DN, where each Di is a vector with different dimension.
Can anybody help me?
Marco.
0 Commenti
Risposta accettata
Più risposte (1)
Azzi Abdelmalek
il 12 Set 2012
Modificato: Azzi Abdelmalek
il 12 Set 2012
for k=1:4
v.(sprintf('D%d',k))=rand(k,2)
end
your array are v.D1, v.D2, ...
Vedere anche
Categorie
Scopri di più su Loops and Conditional Statements in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!