Pol2cart function giving wrong cartesian values, why?

7 views (last 30 days)
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)

Answers (1)

Geoff Hayes
Geoff Hayes on 5 Jan 2015
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.

Categories

Find more on Audio Processing Algorithm Design in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!