Use text in table to make variables
Ältere Kommentare anzeigen
I have a table, T; the first column contains text enclosed in single quotes, and the second column contains scalar numbers:
Symbol Value
1 'Z1' 3
2 'Z2' 4
How can I get Matlab to create variables from the Symbols and assign the Values to them? ie
Z1=3
Z2=4
I could convert T.Symbol into a string vector:
T.Symbol =s,
but how can I convert s into variables, without having to type each variable manually? (In reality, my table contains many rows, and I have more than one table.)
Akzeptierte Antwort
Weitere Antworten (1)
dpb
am 22 Jan. 2021
0 Stimmen
Do NOT even think about doing this.
1 Kommentar
David Slater
am 23 Jan. 2021
Kategorien
Mehr zu Tables 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!