MATLAB: Please how do i make this while statement check all non-positive integers in the vector x below

#vectorconditioning#whilestatements

x = input ('Please input range of values for x: ');
while x <= 0
disp('One or more inputted data is not a positive integer')
x = input ('Please re-input range of values for x: ');
end

Best Answer

This checks for any non-positive values:
while any(x <= 0)
Did you also want to check to see if they are integers? E.g.,
while any(x <= 0) | any(floor(x) ~= x)