isOdd(x)

Simple function to determine if a number is odd or even

You are now following this Submission

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 .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.1.0.0

speed improvement

1.0.0.0

slight speed improvement