Not enough input arguments in embedded function when using fsolve!
Ältere Kommentare anzeigen
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 Kommentare
Walter Roberson
am 8 Jul. 2015
We need code and a traceback of the error.
Mohmmad Teymouri
am 8 Jul. 2015
Bearbeitet: Walter Roberson
am 15 Jul. 2015
Torsten
am 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
am 8 Jul. 2015
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 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)),......
Kategorien
Mehr zu Graphics Object Properties finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!