MATLAB: How to stop executing while loop

MATLABwhile loop

x=1;
while x>0
x+1
end

Best Answer

You can set a condition like below and exit the while loop.
x=1;
while x<10
x = x+1 ;
end