isodd(A,class)

Versión 1.0 (1,1 KB) por Said BOUREZG
ISODD True for set odd
22 descargas
Actualizado 13 may 2017

Ver licencia

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]

Citar como

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

Compatibilidad con la versión de MATLAB
Se creó con R2010a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Numeric Types en Help Center y MATLAB Answers.
Etiquetas Añadir etiquetas

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0