how to calculate magnitude and phase angle of a complex number

for example -7+13i
how do i calculate and display the magnitude and phase angle of this

 Accepted Answer

z = -7+13i
M = abs(z) %magnitude
Ph = angle(z) %phase angle
Ph2 = atan2(imag(z),real(z)) %phase angle

3 Comments

is Ph = angle(z) in degree already?
Yes, it is in radians. You can convert radians to degrees if you wish afterward.

Sign in to comment.

More Answers (2)

x = 1 + i*1;
Magnitude = abs(x);
Phase_radians = angle(x);
Phase_degrees = rad2deg(Phase_radians);

Categories

Find more on Simulink in Help Center and File Exchange

Asked:

on 15 Feb 2012

Answered:

on 12 Sep 2024

Community Treasure Hunt

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

Start Hunting!