Solved
Forgot to add .. you'll need to vectorize your function, because the derivative operator only acts on scalars (and it's always safer to do so as there might be other unintended vector operations that occur, such as dot product rather than element-by-element multiplication).

Stuart
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.

