I want to draw the plot for the relation of Ids-Vds that given by following equations, when Vds>Vds_sat, Ids=Ids_sat:
My code is attached below, it can not plot anything and I don't know why… Can someone gives me some hint about why it can't print anything? Thanks!
% code
vds = 0:1/1000:0.8; %Vds, from 0V to 5V
vgs_vth1 = 1; %Vgs - Vth = 1V
vds_sat = (2*(vgs_vth1))/(1+sqrt(1+vgs_vth1));disp(vds_sat);if(vds <= vds_sat) Ids = (500*(1.04*10^-5)*10*(vgs_vth1*vds-0.5*vds.^2))/(1+0.5*vds); else Ids = (500*(1.04*10^-12/10^-7)*10*(vgs_vth1*vds_sat-0.5*vds_sat.^2))/(1+0.5*vds_sat);endplot(vds,Ids);axis([0 0.8 0 2]);title('Ids-Vds Curve');xlabel({'Vds/V'});ylabel({'Ids/A'});
Best Answer