how to plot multiple curves in same figure

I want to plot Id-vds curve for different length of Aln as it is mentioned as 'daln' in code. I have plotted for 1nm -daln, and need graph for different daln =1.2,3,4,5 nm .
This is the code for daln = 1nm
clear all;
E0=8.85e-12;
Ealgan=10.31;
talgan=23e-9;
calgan=(Ealgan/talgan);
dit=1.2e12;
q=1.6e-19;
gamma=(1/(1+dit*q/calgan));
nd=1.5e16;
daln=1e-9;
fim=(5.1*1.6e-19);
xaln=(1.9*1.6e-19);
fi0=(3.4*1.6e-19);
fis0=(gamma*(fim-xaln)-(gamma*q*nd*daln/calgan));
sigmapol=3.38e17;
sigmaaln=3.38e17;
Ealn=(10.78*E0);
detaEc=(0.343*1.6e-19);
Vt=fis0-detaEc-(sigmapol*q*daln/Ealn);
cq=3.436e15;
ceq=(calgan*cq/calgan+cq);
mu=0.09;
g=33.3;
Vds=0:0.5:6;
vgs=input('ENTER THE vgs in volts');
m=length(Vds);
for i=1:m
if vgs < Vt
current(1,i)=0;
current1(1,i)=0;
elseif Vds(i) >= (vgs - Vt)
current(1,i)=((mu*ceq/2)*(g)*(vgs-Vt)^2); %Simplified equation by approximation
elseif Vds(i) < (vgs - Vt)
current(1,i)=(mu*ceq/2)*(g)*(2*(vgs-Vt)*Vds(i)-Vds(i)^2);%Added DIBL
end
end
plot(Vds,current(1,:),'b')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a hemt')

답변 (1개)

Jan
Jan 2022년 8월 17일

0 개 추천

Create a loop:
axes('NextPlot', 'on'); % As: hold on
...
for daln = 1:5
...
end

댓글 수: 3

Thanks Jan,can you please explain one steps, where I'll write
axes('NextPlot', 'on'); % As: hold on
...
for daln = 1:5
...
end
Try it. You cannot damage Matlab or the computer.
Set the axes() command e.g. on top of the code (after omitting the vrute clearing header "clear all", which is touzght in beginner lessons, but rarely useful in real programs).
Then replace the line
daln = 1;
by
for daln = 1:5
and insert
end
where you want to stop the loop.
ok, Thanks, i'll try

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

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

질문:

2022년 8월 17일

댓글:

2022년 8월 17일

Community Treasure Hunt

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

Start Hunting!

Translated by