From string to a variable
Afficher commentaires plus anciens
Hi everybody, i've a string array array={'dog', 'bike', 'donut'} for example from here i need, for each word, a numeric variable with the same name
dog = 5;
bike = 7;
donut = 54;
(doesn't matter the numbers the most importan thing is to create the variable from the string in array )
Réponse acceptée
Plus de réponses (2)
Paulo Silva
le 18 Avr 2011
assignin('base',char(array(1)),5)
assignin('base',char(array(2)),7)
assignin('base',char(array(3)),54)
1 commentaire
federico valenti
le 18 Avr 2011
Walter Roberson
le 18 Avr 2011
0 votes
Catégories
En savoir plus sur Elementary Math dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!