plot a complex number
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponses (1)
Star Strider
le 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 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots 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!