How do i convert from Complex numbers(a+bi) to a polar form(r,theta) ?
914 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I am writing a script for my microwave amplifier design . I need to convert from the polar form to complex numbers and vice versa . Does Matlab support this function ?
Thank you.
0 Kommentare
Antworten (3)
Azzi Abdelmalek
am 25 Jan. 2014
x=2+3j
rho=abs(x)
theta=angle(x)
%-------------------
x=rho*exp(j*theta)
1 Kommentar
Xuanjun Gong
am 30 Mär. 2020
There is an error for using rho*exp(j*theta) about dimensionality.
It might solve the issue by using:
`x=rho.*exp(j*theta)`
Mischa Kim
am 25 Jan. 2014
Bearbeitet: Mischa Kim
am 25 Jan. 2014
Hello Pradeep, use http://www.mathworks.com/help/matlab/ref/cart2pol.html. You can also find the reverse transformation there.
a = 1 + 2i;
[theta, rho] = cart2pol(real(a), imag(a))
4 Kommentare
Felicia Chiew Pei Wan
am 10 Feb. 2015
Bearbeitet: Felicia Chiew Pei Wan
am 10 Feb. 2015
I can display the s-parameters in a+bi form. However, I would like to convert it to polar form with this kind of arrangements.
Arrangement (in polar form) S11 S21 (S11 AND S22 IN SAME LINE) S12 S22(S12 AND S22 IN NEXT LINE)
On the other hand, "[theta, rho] = cart2pol(real(a), imag(a))". Based on this command, the angle we got is not right. Have to multiple by 180/pi. Any idea on this? Thank you.
Youssef Sherif
am 1 Apr. 2023
Io_polar = sprintf('Io_polar = %.3f ∠ %.3f°', abs(Is(1,1)), rad2deg(angle(Is(1,1))))
0 Kommentare
Siehe auch
Kategorien
Mehr zu Polar Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!