有关于用句柄@和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 中查找有关 基本设置 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!