Loop that creates arrays
Mostra commenti meno recenti
Hey folks I'm trying to write a loop that will create arrays filled with zeros and I'd like it so that each array can be identified somehow (i.e. subscripts, unique name for each array).
In Maple, I would have done something like this... for k to 10 do A[k] := Array(1..10): end do:
which would create 10 arrays and each could be indivually accessed using A[k]. (i.e. A[1] is an array of size 10, A[2] is a different array of size 10 etc...)
Is there a way to do this in Matlab?
Risposta accettata
Più risposte (3)
Sean de Wolski
il 10 Feb 2011
doc cell
You need cell arrays.
Brian
il 10 Feb 2011
0 voti
1 Commento
Walter Roberson
il 10 Feb 2011
These remarks are better done as Comments on the appropriate answer.
Hillary Omuga
il 31 Gen 2020
0 voti
write a for loop to create an array named X. Each value in X is equal to its assaciated index value (a.k.a its position in the array) times 12 minus 1. The size of X is 52*1
Categorie
Scopri di più su Loops and Conditional Statements in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!