I have to use a while loop to ensure user input is an integer between 3 and 50. I set up constraints to do this but once I use the rem function to flag for noninteger it runs and infinite loop for my fprintf. What am I doing wrong?
prompt = ('Enter a number for the length of your array: ');
x = input(prompt);
while (x < 3 || x > 50 || rem(x,1) ~= 0)
fprintf('Please enter an integer between 3 and 50: ');