MATLAB Understanding Matlab's "for" Loop: i = n to j

  • Thread starter Thread starter FrostScYthe
  • Start date Start date
  • Tags Tags
    Loop
AI Thread Summary
The statement "for i = n:-1:j" in MATLAB defines a for loop that initializes the variable i to n and decrements it by 1 in each iteration until it reaches the value of j. The loop executes its body for each value of i from n down to j. This structure allows for backward iteration within a specified range. For further details, reference the MATLAB documentation on for loops.
FrostScYthe
Messages
80
Reaction score
0
What does this statement mean in matlab?

for i = n:-1:j
 
Physics news on Phys.org

Similar threads

Back
Top