Pol2cart function giving wrong cartesian values, why?

7 visualizaciones (últimos 30 días)
Akintomide Ojo
Akintomide Ojo el 5 de En. de 2015
Respondida: Geoff Hayes el 5 de En. de 2015
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)

Respuestas (1)

Geoff Hayes
Geoff Hayes el 5 de En. de 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.

Categorías

Más información sobre Audio Processing Algorithm Design en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by