Not enough input arguments in embedded function when using fsolve!
Show older comments
I have a code which itself is a function but I have also many embedded functions in it. The main function defines a system of non-linear equations. Input arguments to this code are [w, del, v, Pg, Qg]. When I define input arguments and pass them to the function there is no problem and I have output. But when I want to solve it using fsolve (with trust-region-dogleg, because my non-linear system of equations is square) I receive "not enough input arguments" error for one of my embedded functions. What should I do? Why I don't get any errors in case of not using fsolve, but I get the mentioned error while using fsolve?
4 Comments
Walter Roberson
on 8 Jul 2015
We need code and a traceback of the error.
Mohmmad Teymouri
on 8 Jul 2015
Edited: Walter Roberson
on 15 Jul 2015
Torsten
on 8 Jul 2015
What are the variables you want fsolve to solve for ?
What are the equations you want fsolve to solve ?
Where is the call to fsolve ?
Best wishes
Torsten.
Mohmmad Teymouri
on 8 Jul 2015
Accepted Answer
More Answers (1)
Walter Roberson
on 8 Jul 2015
fsolve passes in a vector of values. Your routine expects 4 values. Try
fsolve(@(x) problem(x(1),x(2),x(3),x(4)),......
Categories
Find more on Graphics Object Properties 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!