Hei!
I am trying to compute the following function
function [x,y] = f(z) x=cos(z)*2; y=sin(z)*2; end
The answer I get in the end (z=50) is x=-1.904825 and y=-0.60962. But this answer is not correct.
Can somebody tell me where I did mistake?

 Respuesta aceptada

the cyclist
the cyclist el 13 de Mayo de 2015

0 votos

cos and sin are assuming input in radians. Is that what z is in? If it is in degrees, use cosd and sind instead.

1 comentario

Sergey Dukman
Sergey Dukman el 13 de Mayo de 2015
Ok. I guess this is a reason why I get "wrong" answer. My input is in degrees.
Thank you, Sir

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Install Products en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 13 de Mayo de 2015

Comentada:

el 13 de Mayo de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by