How can I find where those indesirabe plots are from ?

2 visualizaciones (últimos 30 días)
Ilan Boulet
Ilan Boulet el 24 de Ag. de 2022
Comentada: Mathieu NOE el 25 de Ag. de 2022
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 comentario
Abderrahim. B
Abderrahim. B el 24 de Ag. de 2022
So how should look like the plot you want? removing those 'vertical' lines ?

Iniciar sesión para comentar.

Respuesta aceptada

Mathieu NOE
Mathieu NOE el 24 de Ag. de 2022
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;

Más respuestas (0)

Etiquetas

Productos


Versión

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by