有关于用句柄@和fsolve配合求解问题。

>> syms x y
>> f = 3*x+y;
>> g = 5*x +3*y +10 ;
>> h = @(x,y)([f;g]);
>> fsolve(h,[0,0],optimset('Display','off'))
如果以这种方式实现,怎么操作才能供使得定义的句柄能够和fsolve共同使用

 採用された回答

yapalof
yapalof 2022 年 11 月 23 日

0 投票

你的版本太老,不支持matlabFunction
syms x y
f = 3*x+y;
g = 5*x +3*y +10 ;
f1 = eval(['@(x,y)',vectorize(f)]);
g1 = eval(['@(x,y)',vectorize(g)]);
h = @(x) [f1(x(1),x(2)); g1(x(1),x(2))];
fsolve(h,[0,0],optimset('Display','off'))

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange基本设置 についてさらに検索

タグ

質問済み:

2022 年 11 月 23 日

回答済み:

2022 年 11 月 23 日

Community Treasure Hunt

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

Start Hunting!