odd and even functions
显示 更早的评论

given this function is there a way in matlab with which i can know is its odd, even or neither?
采纳的回答
更多回答(1 个)
David Hill
2022-5-6
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
类别
在 帮助中心 和 File Exchange 中查找有关 Histograms 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


