I am trying to plot Vgs versus Id, the problem is when Vgs < Vth , Id should be zero, and I have problem in assigning Id to be 0 for the condition Vgs < Vth.
Rich (BB code):
% Problem 1 A)
Vgs = [0 : 0.01 :1.2]; Vth = 250e-3; Vds = 1.2;
% Vds > Vgs - Vth , transistor in saturation
uCox = 370e-6; lamda = 0.1; W = 5; L = 1;
Id = 1/2 .*uCox .*W/L .*(Vgs - Vth).^2;
for (Vgs < Vth)
Id(1) = 0
++Id;
end
plot(Vgs,Id);
Last edited: