Thread Subject: ceiling or floor block

Subject: ceiling or floor block

From: Steve

Date: 1 Sep, 2007 01:31:48

Message: 1 of 4

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

Subject: ceiling or floor block

From: us

Date: 1 Sep, 2007 03:28:02

Message: 2 of 4

Steve:
<SNIP does not like outliers...

one of the many solutions

% the data
     v=[-10:2:10];
     vmin=-5;
     vmax=5;
% the engine
     vo=v;
     vo(v>vmax)=vmax;
     vo(v<vmin)=vmin;
% the result
     [v;vo]

us

Subject: ceiling or floor block

From: Steve

Date: 1 Sep, 2007 14:16:27

Message: 3 of 4

Thank you, but is there a Simulink block that will do this
automatically? Not a big deal, but just curious. Thanks.

"us " <us@neurol.unizh.ch> wrote in message <fbam82
$1sf$1@fred.mathworks.com>...
> Steve:
> <SNIP does not like outliers...
>
> one of the many solutions
>
> % the data
> v=[-10:2:10];
> vmin=-5;
> vmax=5;
> % the engine
> vo=v;
> vo(v>vmax)=vmax;
> vo(v<vmin)=vmin;
> % the result
> [v;vo]
>
> us

Subject: ceiling or floor block

From: Steven Lord

Date: 3 Sep, 2007 23:19:04

Message: 4 of 4


"Steve " <steveDEL.bachmeierDEL@yahoo.com> wrote in message
news:fbafe4$ngu$1@fred.mathworks.com...
> 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

*snip*

Look at the Saturation block:

http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/saturation.html

or perhaps MinMax:

http://www.mathworks.com/access/helpdesk/help/toolbox/simulink/slref/minmax.html

--
Steve Lord
slord@mathworks.com

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
logical indexing us 31 Aug, 2007 23:30:08
index us 31 Aug, 2007 23:30:08
code us 31 Aug, 2007 23:30:08
floor Steve 31 Aug, 2007 21:35:06
ceiling Steve 31 Aug, 2007 21:35:06
rssFeed for this Thread

Contact us at files@mathworks.com