help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Heaviside function


From: Muthiah Annamalai
Subject: Re: Heaviside function
Date: Tue, 06 Nov 2007 06:19:53 -0600

On Tue, 2007-11-06 at 15:05 -0800, Johann Cohen-Tanugi wrote:
> hello,
> is there a heaviside function implemented in octave/octave-forge?
> thanks,
> Johann



I am not sure which form we want here. 

If you want

               
                { 0   , x < 0; 
heaviside(x) =  { 1/2 , x = 0; 
                { 1   , x > 0; 


But you could define it using sgn,

heaviside = @(x) 0.5*[1 + sgn(x)];

and use the function. This definition is according 
to http://en.wikipedia.org/wiki/Heaviside_step_function in a special
form.

Cheers,
Muthu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]