isodd(A,class)

ISODD True for set odd
22 Downloads
Updated 13 May 2017

View License

ISODD True for set odd.
LIA = ISODD(A) for array, matrice, or value A returns an array of the
same size as A containing true where the elements of A are odd and false otherwise.

LIA = ISODD(A,'char') for character array (string) A returns an array of the
same size as A containing true where the elements of A are odd and false
otherwise.

% Examples:
%
% a = 119
%
% lia1 = isodd(a)
% % returns
% lia = 1
%
% a = [9 9 8 8 7 7 7 6 6 6 5 5 4 4 2 1 1 1]
%
% lia1 = isodd(a)
% % returns
% lia = [1 1 0 0 1 1 1 0 0 0 1 1 0 0 0 1 1 1]
%
%
% a = '10'
%
% lia1 = isodd(a,'char')
% % returns
% lia = 0
%
%
% a = {'11', '9', '12', '8', '5', '11', '7', '8', '6', '14', '101', '5', '4'}
%
% lia1 = isodd(a)
% % returns
% lia = [1 1 0 0 1 1 1 0 0 0 1 1 0]

Cite As

Said BOUREZG (2024). isodd(A,class) (https://www.mathworks.com/matlabcentral/fileexchange/62928-isodd-a-class), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Numeric Types in Help Center and MATLAB Answers
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0