help-octave
[Top][All Lists]

## Re: Puncher soft limiter !!!

 From: Paul Kienzle Subject: Re: Puncher soft limiter !!! Date: Wed, 04 Jun 2003 07:37:45 -0400 User-agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; en-US; rv:1.3) Gecko/20030312

```cctsim wrote:

```
```Hi all,

I have written the c++ code below to implement a
```
puncher funtion for a soft limiter. By definition, that is
```
```
f(x)=x for -A<=x<=A and f(x)=0 otherwise
```You should find the perfomance of
x(x<-A | x>A) = 0;
really large in which case you will
run into other problems. No need
for C++ here.

```
```max(puncher([-5:0.1:5],5))
```
ans = 4.9000 which is wrong !!
```
```
```Try max([-5:0.1:5]).  You may find
that it is 4.9.  Or it may be that it is
a tiny bit above 5 due to cumulative

Next try max(linspace(-5,5,101)), and
see if that is any better.

Paul Kienzle

-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------

```