First time here? Check out the FAQ!
answered 4 years ago
The problem comes from this line:
x=V[0];y=V[1]
If V is a matrix, then x and y become rows, not symbolic variables. In the next line x^2 triggers the error, since a row squared doesn't make sense. Simply Replace it with
V
x
y
x^2
x=V[0, 0]; y=V[1, 0]