Path: news.mathworks.com!not-for-mail
From: "Ongun Palaoglu" <ongun@mac.com>
Newsgroups: comp.soft-sys.matlab
Subject: if statements
Date: Fri, 10 Oct 2008 03:31:02 +0000 (UTC)
Organization: Florida institute of Technolgy
Lines: 27
Message-ID: <gcmi9m$lbj$1@fred.mathworks.com>
Reply-To: "Ongun Palaoglu" <ongun@mac.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1223609462 21875 172.30.248.35 (10 Oct 2008 03:31:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Fri, 10 Oct 2008 03:31:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1541435
Xref: news.mathworks.com comp.soft-sys.matlab:494496


hello guys i am trying to use the if command,
 my code:

%setting parameter
vtn = 0.75;
vds = [0.2 2.5 0];
vgs = [2 2 0];
knp=[200*10^-6 300*10^-6];
kp=knp*10;
i = 1; len = length (vgs);
while i <= len
    x(i)=vds(i)*(vgs(i)-vtn-vds(i)/2);
    i = i + 1;
end
while
id=kp.'*x
if id == 0
    disp('cutoff')
else 
    disp('saturation')
end

this is just an exercise i created. what is teh mistake in here. i want to display the cutoff value and saturation value. for example; 2 saturation.

and I also want to improve this code, i want to use saturation values on a different function.

thanks a ot.