How to assign data to dynamic variable
Ältere Kommentare anzeigen
How to create variables as amany as the length of some vector c and assign data to them
The variables are a1 a2 a3.. a... a10
I would like to assign a1 = [ some data] but would like the script to input the index 1 after a
c = 1:10
for b = 1:length(c)
v = 2*[1:b]
eval(string(['a',num2str(b)])) = v
end
Akzeptierte Antwort
Weitere Antworten (0)
Kategorien
Mehr zu Whos finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!