How to extract a string name from a cell array and use it as name for a new variable?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
I want to make matlab use a string which was previously saved in a cell array for the construction of a new variable name...how can I do this?
eg.
A={'wind force', 'temperature', 'humidity'}
%define a new variable temperature
temperature=input('temperature', 's')
0 Commenti
Risposte (1)
Wayne King
il 10 Giu 2012
Are you sure you want them to input the temperature as a string?
A={'wind force', 'temperature', 'humidity'};
temperature = input(A{2});
0 Commenti
Vedere anche
Categorie
Scopri di più su Characters and Strings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!