How to set up dynamic naming of vectors?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
LETS SAY:
I have a large matrix of unknown size in a text file.
I wish to import it column by column and store each column as a vector.
I wish to name the vectors something like data1,data2,data3,...etc.
================
QUESTION:
How to dynamically name vectors I am creating?
I obviously need to use a loop but how do I set a naming condition?
Z = dlmread('file.txt') %import file in to matrix Z
a = length(Z(1,:)) %acquire number of columns
for N = 1:a
'data+N' = Z(:,N) %obviously wrong but how do I make matlab understand?
end
THANK YOU!
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!