plot a complex number
3 views (last 30 days)
Show older comments
Hi,
can anyone help me please to plot a complex number with real and imaginary parts on a same figure. the complex number is as below: -37.18+1.74i
here is my code:
w1 = 1.37*10^16 %w1 is plasma frequency of gold in Hz%
w2 = linspace (21.99*10^14,1.37*10^16) %w2 is X frequency in Hz%
e1 = 1-(w1).^2./(w2).^2 %e1 is real part of
e3 = (w1.^2)./(w2).^3
e2 = e3*10^14
n = complex (e1,e2)
Many Thanks
0 Comments
Answers (1)
Star Strider
on 1 May 2015
Two possibilities, depending on how you want to depict it:
figure(1)
plot(w2,real(n), w2,imag(n))
grid
xlabel('w_2')
legend('Re','Im','Location','SE')
figure(2)
subplot(2,1,1)
plot(w2,abs(n))
grid
ylabel('Ampitude')
subplot(2,1,2)
plot(w2,angle(n)*180/pi)
grid
xlabel('w_2')
ylabel('Phase (°)')
0 Comments
See Also
Categories
Find more on Annotations 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!