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
Platform Compatibility
Windows macOS LinuxCategories
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
Version | Published | Release Notes | |
---|---|---|---|
1.0 |
|