fsolve with collocation (outside of the function)
2 次查看(过去 30 天)
显示 更早的评论
Consider the following problem. The problems solves the linear(and nonlinear) equation correctly
syms Y11 Y12
r=fsolve(@noneqih,[0 0 ]);
function F=noneqih(co)
Y11=co(1);Y12=co(2);
F=[Y11+Y12-3; Y11-Y12-1]
end
but if you want the values of F set outside of the function noneqih, you can not import them inside e.g the following problem dosnt work
syms Y11 Y12
Agg=[Y11+Y12-3; Y11-Y12-1];
r=fsolve(@noneqih,[0 0 ]);
function F=noneqih(co)
global Agg;
Y11=co(1);Y12=co(2);
F=Agg
end
2 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numbers and Precision 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!