c = input ('what is the cement ratio you require?');while c==0 if c == 0; disp ('Enter a suitable amount'); return else c == 0 break end end %Looking to loop back to the input and repeat the question when 0 is inputted , however, when the code is ran it displays only the quote above and does not loop back to the input. I have probably made a silly mistake, but, I am hoping someone could maybe help.
MATLAB: Looping back to an input
while loop
Related Question
- 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
- For loop not stopping
- What does it mean when you put Loop = 1; in a program
- Running MATLAB ode45 back-to-back
- Changing switch statement to while loop
- Back propagation neural network
Best Answer