import math
import matplotlib.pyplot as plt
import numpy as np
x = np.arange(-4,5,1)
y=(math.sqrt(math.cos(x)))*(math.cos(300*x))+(math.sqrt(abs(x))-0.7*(4-x*x)**0.1)
plt.plot(x,y)
plt.show()
I want to plot this function. It's simple, but I'm having trouble with this. When I run the program, it says:
File "funct.py", line 7, in <module>
y=(math.sqrt(math.cos(x)))*(math.cos(300*x))+(math.sqrt(abs(x))-0.7*(4-x*x)**0.1)
TypeError: only length-1 arrays can be converted to Python scalar