Path: news.mathworks.com!not-for-mail
From: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
Newsgroups: comp.soft-sys.matlab
Subject: ceiling or floor block
Date: Sat, 1 Sep 2007 01:31:48 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 25
Message-ID: <fbafe4$ngu$1@fred.mathworks.com>
Reply-To: "Steve " <steveDEL.bachmeierDEL@yahoo.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1188610308 24094 172.30.248.37 (1 Sep 2007 01:31:48 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 1 Sep 2007 01:31:48 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1034320
Xref: news.mathworks.com comp.soft-sys.matlab:426546



Is there a block where I can limit an input between a lower 
and upper value?  I have a proportional controller, but I 
want to limit the output of the gain to a value in case my 
error gets too large.  As of now I pass the gain's output 
into an m-file with

% INPUTS
Qin=u(1);

% FUNCTIONS
if Qin>maxHeatAdd;
    Qout=maxHeatAdd;
elseif Qin<-maxHeatRemove;
    Qout=-maxHeatRemove;
else
    Qout=Qin;
end

% OUTPUTS
out(1)=Qout;

But, is there a block to do this?

Thanks,
Steve