Convert a Complex Number to exponential real
140 views (last 30 days)
Show older comments
Life is Wonderful on 16 Jun 2021
Edited: Life is Wonderful on 6 Jul 2021
I am looking for help to calculate value of a complex number say x = 2 +1j*5 using exponential function
Robert U on 16 Jun 2021
have a look at Euler's formula (https://en.wikipedia.org/wiki/Euler's_formula).
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)
More Answers (1)
dpb on 16 Jun 2021
MATLAB has builtin functions abs (or hypot()) and angle() for the above explicit implementations...
>> cmplx2exp=@(x) deal(abs(x),angle(x));
Find more on Numeric Types in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!