Azzera filtri
Azzera filtri

plot a complex number

3 visualizzazioni (ultimi 30 giorni)
Jackol Jackil
Jackol Jackil il 1 Mag 2015
Risposto: Star Strider il 1 Mag 2015
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

Risposte (1)

Star Strider
Star Strider il 1 Mag 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 (°)')

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by