Borrar filtros
Borrar filtros

plot a complex number

3 visualizaciones (últimos 30 días)
Jackol Jackil
Jackol Jackil el 1 de Mayo de 2015
Respondida: Star Strider el 1 de Mayo de 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

Respuestas (1)

Star Strider
Star Strider el 1 de Mayo de 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 (°)')

Categorías

Más información sobre 2-D and 3-D Plots en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by