Gistlib Logo

gistlib

how to loop from 10 to 1 in maltab in matlab

You can use a for loop with a decrementing range as follows:

main.m
for i = 10:-1:1
   disp(i);
end
32 chars
4 lines

This will loop from 10 down to 1, printing each value.

similar matlab code snippets

how to calculate the 99th percentile in matlab
how to calculate cumulative distribution function in matlab
how to calculate the binomial distribution in matlab
how to perform a ztest in matlab
how to plot the binomial distribution in matlab
how to calculate the normal distribution in matlab
calculate the area of a triangle in matlab
calculate the area of a sphere in matlab
find the slope of a set of points in matlab
calculate the volume of a pyramid in matlab

related categories

matlab

gistlibby LogSnag