How to create variables from variable names stored in a array?
Afficher commentaires plus anciens
attributes={'time', 'step', 'cuurent', 'voltage', 'chgAh', 'disAh'};
I have stored variable names in this array and i want to store data in them when using in loop. For eg.
if i call out attributes(2)== {some values} then i want this to create a variable named 'step' and load the given data in it. How can i do it?
1 commentaire
Walter Roberson
le 5 Juin 2023
Please read http://www.mathworks.com/matlabcentral/answers/304528-tutorial-why-variables-should-not-be-named-dynamically-eval for information about why we strongly recommend against creating variable names dynamically.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Electromechanical 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!