2 Variable increment in one "for Loop'
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I was using a code and i need to write one "for loop" with two variable incrementing simultaneously. There is easy code in C, C++, but i'm not able to find one for this one. For reference i want to do this in matlab:
for(i=1,j=2;i<10,j<20;i++,j+2)
I can't use nested loop , could someone please help with this.
0 commentaires
Réponses (2)
SHIVAM KUMAR
le 15 Déc 2020
Or use j= 2*i
for i=1:9 %the end term will also come so use 9 here.
j=2*i;
%function
end
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!