if mod(x, 2) == 0
% number is even
else
% number is odd
end

相关文章: