I need to make plot for: this function or this
I made plots before with this code:
x = np.arange(-5, 5, 0.1)
y1 = np.tanh(x)
plt.plot(x,y1)
but how to make something like this?
if(x <= 0):
y4 = 0
else:
y4 = x
gives valueerror:The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()