Computes the Heaviside function. |
||
Syntax |
h = heaviside(x) h = heaviside(x, v) |
|
Arguments |
Name |
Description |
x |
A scalar, vector or matrix. |
|
v |
A scalar: the value of the Heaviside function when x equals 0, by default it is 0.5. |
|
Outputs |
Name |
Description |
h |
A scalar, vector or matrix. h equals if x is greater than 0, h = 0 if x is lesser than 0. |
|
Example |
Syntax |
|
x = [-2:0.005:2] h = heaviside(x) PlotLine(x,h) |