%determines if an integer is odd or even

function [out] = odd (in);

if in ~= round(in); %check to make sure the input is an integre
    error('input must be an integer')
end

out = in ~= 2*round(in/2); % should be 1 if odd, 0 if even;
