Write a user defined function to implement the following mathematical function :

3 vues (au cours des 30 derniers jours)
Majid Alomari
Majid Alomari le 21 Oct 2020
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

Réponses (1)

David Hill
David Hill le 21 Oct 2020
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

Catégories

En savoir plus sur Mathematics dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by