How can I find where those indesirabe plots are from ?

조회 수: 2 (최근 30일)
Ilan Boulet
Ilan Boulet 2022년 8월 24일
댓글: Mathieu NOE 2022년 8월 25일
Hello.
I am running the following code:
%% Ids(Vds) %%
mu=10;
Cox=3.9;
W=360*(10^(-9));
L=180*(10^(-6));
K=(mu*Cox)*(W/L);
Vth=1;
vds=0:0.2:20;
vgs=0:0.2:20;
n=length(vgs);
m=length(vds);
for j=1:n
for i=1:m
if vgs(j) < Vth
current(1,i)=0;
elseif vds(i) >= (vgs(j) - Vth)
current(1,i)=0.5* K * (vgs(j) - Vth)^2;
elseif vds(i) < (vgs(j) - Vth)
current(1,i)= K*((vgs(j)-Vth)*vds(i) - 0.5*(vds(i)^2));
hold on
end
plot(vds,current(1,:),'b')
xlabel('Vds (V)')
ylabel('Drain Current (A)')
title('I-V Characteristics of a MOSFET')
end
end
hold off;
And this is what I obtain when I plot the thing you can see in the attached file.
As you can see, there are some vertical plots that made a very beatiful spider-net-shape but this not what I am looking for.
I tried to change, kinda randomly I assume, some things in the loop but it didn't work.
Thank you for your help !
  댓글 수: 1
Abderrahim. B
Abderrahim. B 2022년 8월 24일
So how should look like the plot you want? removing those 'vertical' lines ?

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

채택된 답변

Mathieu NOE
Mathieu NOE 2022년 8월 24일
hello
maybe this ?
%% Ids(Vds) %%
mu=10;
Cox=3.9;
W=360*(10^(-9));
L=180*(10^(-6));
K=(mu*Cox)*(W/L);
Vth=1;
vds=0:0.2:20;
vgs=0:0.2:20;
n=length(vgs);
m=length(vds);
for j=1:n
for i=1:m
if vgs(j) < Vth
current(1,i)=0;
elseif vds(i) >= (vgs(j) - Vth)
current(1,i)=0.5* K * (vgs(j) - Vth)^2;
elseif vds(i) < (vgs(j) - Vth)
current(1,i)= K*((vgs(j)-Vth)*vds(i) - 0.5*(vds(i)^2));
hold on
end
end
plot(vds,current(1,:),'b')
xlabel('Vds (V)')
ylabel('Drain Current (A)')
title('I-V Characteristics of a MOSFET')
end
hold off;

추가 답변 (0개)

카테고리

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

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by