MATLAB Answers

Complex number to polar form

71 views (last 30 days)
Tobias Ottsen
Tobias Ottsen on 20 Oct 2020
Answered: Steven Lord on 20 Oct 2020
Hi
How do i calculate this complex number to polar form?
z = (10<-50)*(-7+j10) / -12*e^-j45*(8-j12)

  0 Comments

Sign in to comment.

Answers (3)

Ameer Hamza
Ameer Hamza on 20 Oct 2020
The number you wrote in not correct according to MATLAB syntax. You can use abs() and phase() to convert complex numbers to polar coordinate
z = 2 + 3j;
r = abs(z);
angle = phase(z);

  0 Comments

Sign in to comment.


Star Strider
Star Strider on 20 Oct 2020
Use the abs (magnitude) and angle (radian phase angle) functions.
The phasor notation for it would be:
phasor = [abs(z) angle(z)]
However you cannot calculate anything until you resolve the problem:
z = (10<-50)*(-7+j10) / -12*exp(-j45*(8-j12))
↑ ← HERE
That is not valid MATLAB code. (I also corrected the ‘e^’ notation for the exponential function.)
(Another problem is ‘j10’, ‘j45’ and ‘j12’. I am not certain what they are, however using numbered variables such as these is generally considered poor programming practice. Put them in a vector and reference them as elements of the vector.)

  2 Comments

Tobias Ottsen
Tobias Ottsen on 20 Oct 2020
z = (10<-50)*(-7+i10) / -12*exp(-i45)*(8-i12)) This maybe the right syntax. I use J instead of i ;). I just need to se a method to calculate it
Star Strider
Star Strider on 20 Oct 2020
I posted the way to calculate it as:
phasor = [abs(z) angle(z)]
or in function form:
phasor = @(z) [abs(z) angle(z)];
If you want to use ‘i’ or ‘j’ as imaginary operators, the number has to precede the ‘i’ or ‘j’, so 45j is evaluated as 0 + 45i. I believe this is what you want.
The problem is still the ‘less than’ (<) sign in the ‘z’ calculation that I pointed out (with arrows ↑← !) in my original Answer. That is not correct MATLAB syntax, and will throw an error, so you cannot calculate anything until you correct it. I have no idea what you want to do there, so I am only suggesting that you eliminate the (<).

Sign in to comment.


Steven Lord
Steven Lord on 20 Oct 2020
Use pol2cart and cart2pol to convert between the (r, theta) and (real, imag) representations of the complex numbers. Since I'm guessing your angles are in degrees you'll also need deg2rad and rad2deg.

  0 Comments

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by