The function gradient(F) computes and returns the one-dimensional numerical gradient of vector "F". The function takes the input arguments:
- F - Input array, specified as a vector, matrix, or multidimensional array.
- h (optional) - Uniform spacing between points in all directions.
- hx, hy, hN (optional) - Spacing between points in each direction, specified as separate inputs of scalars or vectors. The number of inputs must match the number of array dimensions of F.
In your code snippet, "alpha" and "x0" are both scalars which is why you are observing an error with the function call.