I'm trying to create an unknown variable in numpy in order to calculate eigenvalues without using the built in functions. I want to create a matrix that looks like this for example
-x 1
-2 -3-x
But entering x
into a matrix, it won't recognize what x
is and I don't know how to define it properly. This is my code so far and it says that x is not defined.
x=x
A = np.array([[0,1-x],[-2,-3-x]])
B = np.array([[0,1],[-2,-3]])
print(B)
How do I define the variable x
so that I can use it as an algebra function?