There are two loops in matlab:
For loops
While loops
For loops are used when the number of loop is certain whereas while loops are used when the condition is specified for a loop to terminate the code in it.
You can see the usage form of for loops and while loops from given examples below:
Example 1: For loop
for i=1:4,
i
end
Example 2: While loop
a=0;
while(a<10)
a= a+1;
a
For information in detail...