For loop with running parameter out of struct
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hello, I would like to run a for loop like this:
for Test.i=1:100 do something end
My intention is to have one struct where all my variables from my quite small script are stored and I don't mess up the workspace of the whole model.
Thanks in advance
0 commentaires
Réponses (2)
madhan ravi
le 24 Oct 2018
Modifié(e) : madhan ravi
le 24 Oct 2018
for i=1:100
Test.x(i)=i ; %an example
Test.y(i)=x.^(i) ;
end
save('mymat.mat',Test)
0 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!