Can't seem to get my while loop to execute.
-No error showing
-Getting rid of 1 initial condition in 'while' loop and the script runs (not how I want though). I need my 'while' loop to accept a number between 1 and 12 (corresponds to 1=Jan, 2=Feb, etc).
Any help with this greatly appreciated!
Script Below:
clear allclcM = 100;Y = -100;disp('After selecting a month and year, the number of days within that month will be displayed.')while Y<0Y = input('Please select a year: ');endwhile (M<0) & (M>12)M = input('Please select a month: ');end
Best Answer