??? Error using ==> evalin Undefined function or method 'arctan' for input arguments of type 'double'.
Show older comments
I'm trying to figure out why I keep getting the error:
??? Error using ==> evalin Undefined function or method 'arctan' for input arguments of type 'double'.
I'm trying to optimize a large function with symbolic variables in it using Hessian and gradient matrices and multidimensional Newton optimization techniques (namely, x1=x0-(H(x0))^-1)*grad(f(x0))).
That error crops up at different points in running. Sometimes it happens after the first iteration; other times, it happens after 3 or 4 runs through.
The objective function is: (T-atan(((Py+Vy*k)-Psy)/((Px+Vx*k)-Psx)); where Px, Vx, Py, and Vy are the symbolic variables that are in need of optimization. The others have values being assigned to them already. The command jacobian is used to find the gradient, and then applied again to acquire the Hessian. The Hessian and Jacobian are summed 30 times with varying numbers to form a large expression. An appropriate initial guess is being used. The eval command is being used to compute the gradient and Hessian matrices with values subbed in.
Any ideas on why this error keeps occurring?
2 Comments
Sean de Wolski
on 2 Dec 2011
What is the string you're feeding evalin? This is why the use of evalin/eval/assignin bis recommended against because bugs are hard to catch.
Are you sure you don't have 'arctan' instead of 'atan' somewhere?
Mike E.
on 2 Dec 2011
Accepted Answer
More Answers (0)
Categories
Find more on Special Values in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!