plot a complex number
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
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 Kommentare
Antworten (1)
Star Strider
am 1 Mai 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 Kommentare
Siehe auch
Kategorien
Mehr zu Annotations 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!