Matlab判断一个数值的奇偶性

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

posted @ 2017-11-21 09:37  Avin  阅读(8948)  评论(0编辑  收藏  举报