フィルターのクリア

Is it possibile to use fsolve(fun,x0) giving input to fun?

1 回表示 (過去 30 日間)
giannit
giannit 2019 年 2 月 15 日
回答済み: Torsten 2019 年 2 月 15 日
I have to solve this system of equations:
function F = root2d(x)
[a,b,c,d,e,f]=feval(@(x) x{:}, {151.9,67,67.8,13790,4410,1000});
F(1) = a*x(1)+c*x(1)*2.5*x(2)+f*2.5*x(2)-d;
F(2) = b*x(1)+c*x(1)*1.5*(1-x(2))+f*1.5*(1-x(2))-e;
with main file
fun = @root2d;
x0 = [24,0.5];
x = fsolve(fun,x0)
Since I have to solve the system for different values of a b c d e f, is it possibile to give them as input to the fun function?
I tried writing
function F = root2d(x,a,b,c,d,e,f)
but then it is not possibile to call the function by
fun = @root2d(a,b,c,d,e,f)

採用された回答

Torsten
Torsten 2019 年 2 月 15 日
fun = @(x)root2d(x,a,b,c,d,e,f)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSymbolic Math Toolbox についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by