In matlab
, you can use the for
loop in the following way to achieve the functionality of for i in range(n)
in Python:
main.m39 chars4 lines
In this loop, i
starts from 1
and goes up to n
(inclusive) in steps of 1
. You can replace n
with any integer value based on your requirement.
Here is an example loop that prints the values of i
from 1
to n
:
main.m36 chars5 lines
Output:
main.m10 chars6 lines
gistlibby LogSnag