Help using an If statement with arrays
Información
La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.
Mostrar comentarios más antiguos
Create a plot of iD as a function of vDS from 0 ≤ vDS ≤ 8 V, for three values of vGS =2, 3, and 4 V.
Constants: Kn=0.2 mA/V2; VTN =1.2 V; λ=0.01 V-1.
Here is my work I have so far:
Vds = 0:0.1:8;
Vgs = 2:1:4;
kn = 0.2;
Vtn = 1.2;
lambda = 0.01;
Vds_Sat = Vgs - Vtn;
if (Vds <= Vds_Sat)
ID = Kn*(2*(Vgs-Vtn)*Vds - (Vds.^2));
else (Vds >= Vds_Sat)
ID = Kn*((Vgs - Vtn).^2*(1 + lambda * Vds));
end
plot(Vds,ID)
1 comentario
Walter Roberson
el 21 de En. de 2013
Respuestas (1)
Matt J
el 21 de En. de 2013
0 votos
Seems like this was already answered here
La pregunta está cerrada.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!