loop to 10 in matlab

You can use a for-loop to iterate from 1 to 10 in MATLAB as follows:

main.m
for i = 1:10
    % your code here
end
38 chars
4 lines

This loop will execute the code inside the loop 10 times, with the loop variable i taking on the values 1, 2, 3, ..., 10 in each iteration. You can replace % your code here with the actual code you want to execute inside the loop.

gistlibby LogSnag