??? Error using ==> evalin Undefined function or method 'arctan' for input arguments of type 'double'.
显示 更早的评论
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 个评论
Sean de Wolski
2011-12-2
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.
2011-12-2
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Special Values 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!