How to convert symbolic Jacobian to use it in lsqnonlin?
Show older comments
I have created Jacobian using Matlab build in function:
J = jacobian([functforJacobian],[p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 ]); This Jacobian is symbolic: J 53x12 112 sym Now I need to use this Jacobian in lsqnonlin:
opts = optimoptions(@lsqnonlin,'Jacobian','on'); [p,resnorm,res] = lsqnonlin(@myfun3,pguess,[],[],opts); but lsqnonlin do not understand sym. How should I convert my Jacobian to use it in lsqnonlin? Thanks for the help
Answers (1)
Alan Weiss
on 19 May 2015
0 votes
There are some documentation examples on closely-related questions.
Symbolic gradients and Hessians using files.
Symbolic derivatives using function handles.
I'm sure that either of these examples will help.
Alan Weiss
MATLAB mathematical toolbox documentation
Categories
Find more on Symbolic Math Toolbox 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!