Heaviside Function

Heaviside Function#


Heaviside Step Function Wiki
$\( H(x)= \begin{cases} 1 & x \gt 0 \\ 0 & x \lt 0 \\ \end{cases} \)$


import numpy             as np
import matplotlib.pyplot as plt

x = np.linspace(-2, 2, 4001)
a = -1
b = 1
y = np.where(x < 0, 0, 1)
plt.plot(x, y);
../../_images/8487ef761c16c00cc66437723a6d2180bd99d28b4023b355b51ad040df976402.png