Updating a value inside for loop
Afficher commentaires plus anciens
Hi All,
I have a for loop inside which, various operations are running. There are a few variable inside that loop which I want to update after every 4 iterations of the loop.
Lets say we have this situation
a = 1:100
X= X+Y
....
....
Y = 123;
end
I want this Y to update after 4 iterations as in, for a=1:4, the value of Y remains same and for a=5:8, it remains same and so on.
How should I perform this.
Regards
Anum
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Common Operations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!