Convert a Complex Number to exponential real
30 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Life is Wonderful
le 16 Juin 2021
Modifié(e) : Life is Wonderful
le 6 Juil 2021
Hi
I am looking for help to calculate value of a complex number say x = 2 +1j*5 using exponential function
Thanks you
0 commentaires
Réponse acceptée
Robert U
le 16 Juin 2021
Hi Jogger,
x = 2 + 1j * 5;
r = sqrt(real(x)^2 + imag(x)^2);
phi = atan2(imag(x),real(x));
fprintf(1,'z = r * exp(j*phi)\nr = %.2f\nphi = %.2f',r,phi)
Kind regards,
Robert
0 commentaires
Plus de réponses (1)
dpb
le 16 Juin 2021
MATLAB has builtin functions abs (or hypot()) and angle() for the above explicit implementations...
>> x=complex(2,5);
>> cmplx2exp=@(x) deal(abs(x),angle(x));
>> [r,theta]=cmplx2exp(x)
r =
5.3852
theta =
1.1903
>>
3 commentaires
Life is Wonderful
le 17 Juin 2021
Modifié(e) : Life is Wonderful
le 17 Juin 2021
Life is Wonderful
le 17 Juin 2021
Modifié(e) : Life is Wonderful
le 17 Juin 2021
Voir également
Catégories
En savoir plus sur MATLAB Coder dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!