필터 지우기
필터 지우기

Function computation in Matlab

조회 수: 1 (최근 30일)
Sergey Dukman
Sergey Dukman 2015년 5월 13일
댓글: Sergey Dukman 2015년 5월 13일
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?

채택된 답변

the cyclist
the cyclist 2015년 5월 13일
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
Sergey Dukman
Sergey Dukman 2015년 5월 13일
Ok. I guess this is a reason why I get "wrong" answer. My input is in degrees.
Thank you, Sir

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by