How to create a matrix of numbers from workspace variables?
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have 70 double variables of size 1500x1(let's call them a1,a2....a70) loaded in workspace. I would like to create a matrix M which contains these variables as columns, so that the matrix size will be 1500x70. Is there an efficient way to do this?
1 Kommentar
Antworten (1)
Stephen23
am 24 Feb. 2016
Yes there is an efficient way to do this: don't create 70 numbered variables in your workspace.
How did you "create" them?
If it was by load, then simply call load with an output argument:
S = load(...)
If you created your 70 variables some other way then let us know and we can show you a much better way of programming.
Read my answer to know why accessing 70 variables in a loop is slow, buggy, and obfuscated way to program:
0 Kommentare
Siehe auch
Kategorien
Mehr zu Logical 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!