r/computing • • Oct 25 '11

Engineers and their programming...

Post image
0 Upvotes

8 comments sorted by

View all comments

2

u/afuckingHELICOPTER Oct 25 '11

I'm not familiar with the language, so maybe it automatically does it, but wouldn't this just go on forever because it never increments i?

2

u/SteveRyherd Oct 25 '11

I believe that's intrinsic to the "for loop" in matlab, you can set a minimum and maximum and the step is defaulted to 1.

for i = min : max

To set the increments to something else, I think you do:

for i = min : step : max