Products & Services Solutions Academia Support User Community Company

Learn more about Symbolic Math Toolbox   

heaviside - Compute Heaviside step function

Syntax

heaviside(x)

Description

heaviside(x) has the value 0 for x < 0, 1 for x > 0, and 0.5 for x = 0.

Examples

For x < 0 the function heaviside(x) returns 0:

heaviside(sym(-3))
ans =
0

For x > 0 the function, heaviside(x) returns 1:

heaviside(sym(3))
ans =
1

For x = 0 the function, heaviside(x) returns 1/2:

heaviside(sym(0))
ans =
1/2

For numeric x = 0 the function, heaviside(x) returns the numeric result:

heaviside(0)
ans =
    0.5000

See Also

dirac

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS