Check out example codes for "matlab while loop". It will help you in understanding the concepts better.

Code Example 1

n = 10;
while n > 1
    n = n-1;
end

Learn ReactJs, React Native from akashmittal.com