How can I compute the Jacobian of a vector-valued function dependent on more than one variable using MATLAB 7.10 (R2010a)?
20 views (last 30 days)
Show older comments
MathWorks Support Team
on 10 Sep 2012
Edited: MathWorks Support Team
on 14 Oct 2022
I want to compute the Jacobian of a vector-valued function dependent on more than one variable at a specified point.
Accepted Answer
MathWorks Support Team
on 14 Oct 2022
Edited: MathWorks Support Team
on 14 Oct 2022
If you have access to the Optimization Toolbox, you can use the LSQNONLIN function to numerically compute the Jacobian of a vector-valued function at a specified point. To do this, execute LSQNONLIN with the specified point as the starting point, set the ‘MaxIter’ option to zero, and extract the ‘jacobian’ output argument. For example:
k = 1:10;
F = @(x) 2 + 2*k-exp(k*x(1))-exp(k*x(2)); % Vector valued function dependent on two variables
x0 = [0.3 0.4] % Point at which Jacobian needs to be estimated
[x,~,~,~,~,~,jacobian] = lsqnonlin(F,x0,[],[],optimset('MaxIter',0))
Please not that the Jacobian is computed numerically and contains inaccuracies. In other words, it is not an analytical Jacobian. The exact algorithm used to compute the Jacobian, is dependent on the ‘Algorithm’ setting with which LSQNONLIN is called. For details about the algorithm used in computing the Jacobian, please see references listed on the following documentation page:
0 Comments
More Answers (0)
See Also
Categories
Find more on Systems of Nonlinear Equations 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!