Using for loops in referencing
Afficher commentaires plus anciens
Hello everyone
I would like to create new datasets separately through a for loop.
for n=0:5:40
netload'n'=Y-n.*Koutput
end
% the results should give me nine outputs which would be somethig like
netload0=Y-0.*Koutput
netload5=Y-5.*Koutput
"" + ...
""
netload40=Y-40.*Koutput
How can I execute that using a for loop?
Thank you.
1 commentaire
Guillaume
le 18 Juil 2019
You should never create numbered, or sequentially named, variables. Embedding any form of indexing in the variable name is always a bad design. See Tutorial: Why Variables Should Not Be Named Dynamically for more details.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!