Solving nonlinear set of equation using lsqnonlin
1 view (last 30 days)
Show older comments
I'm writing a code to solve nonlinear set of equations using lsqnonlin. But I'm getting the error: "Nonscalar arrays of function handles are not allowed; use cell arrays instead." I don't know how to go about it. Please help. Attached is the matlab code and required files.
0 Comments
Answers (1)
Matt J
on 30 Dec 2014
Edited: Matt J
on 30 Dec 2014
You cannot generate the different residual terms in the least squares objective with separate functions. A single function, supplied by you, must be used to generate all N residuals. The objective function that you supply must return the residuals in an Nx1 vector.
2 Comments
Matt J
on 31 Dec 2014
I believe I already told you. Generate the residuals with 1 function, instead of many.
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!