Not enough input arguments in embedded function when using fsolve!
显示 更早的评论
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 个评论
Walter Roberson
2015-7-8
We need code and a traceback of the error.
Mohmmad Teymouri
2015-7-8
编辑:Walter Roberson
2015-7-15
Torsten
2015-7-8
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
2015-7-8
采纳的回答
更多回答(1 个)
Walter Roberson
2015-7-8
fsolve passes in a vector of values. Your routine expects 4 values. Try
fsolve(@(x) problem(x(1),x(2),x(3),x(4)),......
类别
在 帮助中心 和 File Exchange 中查找有关 Graphics Object Properties 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!