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!