isodd(A,class)

Version 1.0 (1,1 KB) von Said BOUREZG
ISODD True for set odd
22 Downloads
Aktualisiert 13. Mai 2017

Lizenz anzeigen

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]

Zitieren als

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

Kompatibilität der MATLAB-Version
Erstellt mit R2010a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Numeric Types finden Sie in Help Center und MATLAB Answers
Tags Tags hinzufügen

Community Treasure Hunt

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

Start Hunting!
Version Veröffentlicht Versionshinweise
1.0