Using for loops in referencing
Mostra commenti meno recenti
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 Commento
Guillaume
il 18 Lug 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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!