Write a user defined function to implement the following mathematical function :
2 次查看(过去 30 天)
显示 更早的评论
Write a user defined function to implement the following mathematical function : please note that x is angle in degrees.
f (x) = cos (x) if 0 < x < 90
f(x)= sin(x) if 90 < x < 180
f(x)=tan(x) otherwise
0 个评论
回答(1 个)
David Hill
2020-10-21
function y = f(x)
if x>0&&x<90
y=cosd(x);
elseif x>90&&x<180
y=sind(x);
else
y=tand(x);
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Mathematics and Optimization 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!