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;
  2 件のコメント
Ilan Boulet
Ilan Boulet 2022 年 8 月 25 日
Thanks a lot !
Mathieu NOE
Mathieu NOE 2022 年 8 月 25 日
My pleasure !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolygons についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by