0% found this document useful (0 votes)
134 views1 page

MOSFET Output Characteristics in MATLAB

This MATLAB code simulates the output characteristics of an n-channel enhancement mode MOSFET by sweeping the drain-source voltage from 0 to 10V, calculating the drain current based on the gate-source voltage input by the user and MOSFET parameters including threshold voltage and transconductance, and plotting the resulting I-V curve. Key parameters like threshold voltage, transconductance, and drain/gate voltages are defined and the current is calculated in different regions depending on the relative voltages.

Uploaded by

Supriya Sajwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views1 page

MOSFET Output Characteristics in MATLAB

This MATLAB code simulates the output characteristics of an n-channel enhancement mode MOSFET by sweeping the drain-source voltage from 0 to 10V, calculating the drain current based on the gate-source voltage input by the user and MOSFET parameters including threshold voltage and transconductance, and plotting the resulting I-V curve. Key parameters like threshold voltage, transconductance, and drain/gate voltages are defined and the current is calculated in different regions depending on the relative voltages.

Uploaded by

Supriya Sajwan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

MATLAB code

%n-channel enhancement mode MOSFET output characteristics


clear all;
%kn=un*cox = 100 microA/Volts
kn=1e-4;
%Let W/L= 2
W=360*(10^(-9));
L=180*(10^(-9));
beta=kn*W/L;
%Vth is the threshold voltage
Vth=1;
%Sweep drain to source voltge from 0 to 10V
vds=0:0.5:10;
%Ask the user to enter gate to source voltage
vgs=input('ENTER THE Vgs in volts');
%Estimate length of the array
m=length(vds);
for i=1:m

if vgs < Vth


current(1,i)=0;
elseif vds(i) >= (vgs - Vth)
current(1,i)=0.5* beta * (vgs - Vth)^2;
elseif vds(i) < (vgs - Vth)
current(1,i)= beta*((vgs-Vth)*vds(i) - 0.5*(vds(i)^2));
end

end
plot(vds,current(1,:),'b')
xlabel('Vds, V')
ylabel('Drain Current,A')
title('I-V Characteristics of a MOSFET')

You might also like