x=input('enter k');n=numel(x);while n<3 x=input('enter correct number of k'); n=numel(x); if n<3 continue; else while any(x<0) x=input('enter positive numbers of k'); if any(x<0) continue; else break; end end endend
MATLAB: If i have a nested while loop and the second condition of the loop is true but first is wrong how to make it go back again to the first while loop
#nested#while#loops
Best Answer