odd and even functions
Afficher commentaires plus anciens

given this function is there a way in matlab with which i can know is its odd, even or neither?
Réponse acceptée
Plus de réponses (1)
David Hill
le 6 Mai 2022
x=-pi:.001:pi;
f=@(x).5*(sin(x)+abs(sin(x)));
if isequal(f(x),f(-x))
even_odd=2;%even
elseif isequal(-f(x),f(-x))
even_odd=1;%odd
else
even_odd=0;%neither
end
1 commentaire
SSBGH
le 6 Mai 2022
Catégories
En savoir plus sur Line Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


