From: DSPtree on
Hi, help me with the function that does

(x)= x if x>=0
0 if x<0
From: Torsten Hennig on
> Hi, help me with the function that does
>
> (x)= x if x>=0
> 0 if x<0

function f=myfun(x)
if (x>0)
f=x;
else
f=0.0;
end;

Best wishes
Torsten.
From: Cris Luengo on
DSPtree <paulscot45(a)yahoo.com> wrote in message <918666703.20297.1279011925051.JavaMail.root(a)gallium.mathforum.org>...
> Hi, help me with the function that does
>
> (x)= x if x>=0
> 0 if x<0

Why is this URGENT???

x = max(x,0);

Cheers,
Cris.
From: Walter Roberson on
DSPtree wrote:
> Hi, help me with the function that does
>
> (x)= x if x>=0
> 0 if x<0

@(x) x .* x >= 0;