How can I get dynamic naming variables? So in a loop i need variables with names A1,A2,A3...... logic?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
the loop running should produce N outputs with each having label A1,A2,A3....An
1 commentaire
Réponses (1)
CS Researcher
le 1 Mai 2016
You can use eval. Try this:
for i = 1:10
eval(['A' num2str(i) ' = i;']);
end
2 commentaires
Voir également
Catégories
En savoir plus sur Loops and Conditional Statements dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!