Matlabで奇数と偶数の判別をおこなうには、mode かremが利用できる。
cf.
初心者によるMATLABメモ
[基本] 奇数と偶数の判別
http://sach1o.blog80.fc2.com/blog-entry-29.html
mod (MATLAB Function Reference)
http://dl.cybernet.co.jp/matlab/support/manual/r13/toolbox/matlab/ref/?/matlab/support/manual/r13/toolbox/matlab/ref/mod.shtml
rem (MATLAB Function Reference)
http://dl.cybernet.co.jp/matlab/support/manual/r13/toolbox/matlab/ref/?/matlab/support/manual/r13/toolbox/matlab/ref/rem.shtml
cf.
初心者によるMATLABメモ
[基本] 奇数と偶数の判別
http://sach1o.blog80.fc2.com/blog-entry-29.html
mod (MATLAB Function Reference)
http://dl.cybernet.co.jp/matlab/support/manual/r13/toolbox/matlab/ref/?/matlab/support/manual/r13/toolbox/matlab/ref/mod.shtml
rem (MATLAB Function Reference)
http://dl.cybernet.co.jp/matlab/support/manual/r13/toolbox/matlab/ref/?/matlab/support/manual/r13/toolbox/matlab/ref/rem.shtml