Pol2cart function giving wrong cartesian values, why?
조회 수: 7 (최근 30일)
이전 댓글 표시
Using the code pol2cart and cart2pol, trying to prove that the rho and theta input can be retrieved back but its not giving the same values. HELP!
prompt1 = 'what is I1?';
prompt2 = 'what is I1 angle?';
RHO = input(prompt1);
THETA = input(prompt2);
[X,Y] = pol2cart(RHO,THETA)
[THETA1,RHO1] = cart2pol(X,Y)
댓글 수: 0
답변 (1개)
Geoff Hayes
2015년 1월 5일
Akintomide - you may need to provide an example of the code not working. Remember, according to pol2cart, the theta must be in radians AND the input to plo2cart is THETA first and then RHO. For example,
RHO = 42.3;
THETA = pi/4;
[X,Y] = pol2cart(THETA,RHO)
[THETA1,RHO1] = cart2pol(X,Y)
produces the expected/desired result.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!