필터 지우기
필터 지우기

Graph two curves in the same plane

조회 수: 1 (최근 30일)
Yordani
Yordani 2022년 12월 30일
댓글: Walter Roberson 2022년 12월 30일
Hello! I'm trying to graph the function e1 and e2 in the same plane but I can't. Could you please help me :(
%Permitividad Parte Real
e_inf = 11.7 ;
Wp1 = 1.0856e11;
gamma1 = 2.3518e9 ;
Wp2 = 3.4330e11;
gamma2 = 5.6747e9 ;
w1 = 1e11;
w2 = 1e10;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
% Loop is not necessary!
e1 = e_inf - ((Wp1^2)./K.^2+1i*K*gamma1);
e2 = e_inf - ((Wp2^2)./K.^2+1i*K*gamma2);
f=K;
x=f;
y1 = real(e2);
semilogx(x,y1, 'linewidth',2), grid on
hold on
y2 = real(e2);
semilogx(x,y2, 'linewidth',2), grid on
hold off
  댓글 수: 2
Yordani
Yordani 2022년 12월 30일
Hello! Yes thank you very much :D
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022년 12월 30일
Most welcome! Glad to help

댓글을 달려면 로그인하십시오.

채택된 답변

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2022년 12월 30일
To plot two curves are simple as follows:
e_inf = 11.7 ;
Wp1 = 1.0856e11;
gamma1 = 2.3518e9 ;
Wp2 = 3.4330e11;
gamma2 = 5.6747e9 ;
w1 = 1e11;
w2 = 1e10;
w3 = 1e15;
index = 0;
K = w1:w2:w3;
% Loop is not necessary!
e1 = e_inf - ((Wp1^2)./K.^2+1i*K*gamma1);
e2 = e_inf - ((Wp2^2)./K.^2+1i*K*gamma2);
f=K;
x=f;
figure
y1 = real(e1);
semilogx(x,y1, 'r-','linewidth',2, 'displayName', 'e_1')
hold on
y2 = real(e2);
semilogx(x,y2, 'b-', 'linewidth',2,'displayName', 'e_2'), grid on
hold off
legend('toggle')
  댓글 수: 1
Walter Roberson
Walter Roberson 2022년 12월 30일
in particular you had used real(e2) for both y1 and y2

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Legend에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by