How to convert symbolic Jacobian to use it in lsqnonlin?

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)

There are some documentation examples on closely-related questions.
Symbolic derivatives using function handles.
I'm sure that either of these examples will help.
Alan Weiss
MATLAB mathematical toolbox documentation

Categories

Asked:

on 19 May 2015

Answered:

on 19 May 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!