MATLAB: Matlab confirm is input is not an array

arrayintegerswhile loop

Confirm that the input is a positive integer and not an array. I got this far, but when I type in [1 2 3] is does not prompt to enter in the positive integer again.
n = input('Enter in a positive integer: ')
while (n<0) & (isvector(n))
n = input('Enter in a positive integer: ')
end

Best Answer

n = input('Enter in a positive integer: ')
while n<0 | numel(n)>1 | fix(n)~=n
n = input('Enter in a positive integer: ')
end