isOdd(x)

Simple function to determine if a number is odd or even
127 Downloads
Updated 2 Aug 2017

View License

isOdd determines if a number is odd or even.
isOdd takes an array of numbers, and returns a logical array of the same
size as the input, where true (1) is odd, and false (0) is even.
tf = isOdd(5)
tf =
1
tf = isOdd([1 2 3])
tf =
1 0 1
Created by David Coventry, 7/26/2017

Cite As

David Coventry (2026). isOdd(x) (https://www.mathworks.com/matlabcentral/fileexchange/63890-isodd-x), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R10
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Data Type Identification in Help Center and MATLAB Answers
Version Published Release Notes
1.1.0.0

speed improvement

1.0.0.0

slight speed improvement