Not enough input arguments in embedded function when using fsolve!
Afficher commentaires plus anciens
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 commentaires
Walter Roberson
le 8 Juil 2015
We need code and a traceback of the error.
Mohmmad Teymouri
le 8 Juil 2015
Modifié(e) : Walter Roberson
le 15 Juil 2015
Torsten
le 8 Juil 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
le 8 Juil 2015
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 8 Juil 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)),......
Catégories
En savoir plus sur Graphics Object Properties dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!