Using fsolve with vector as argument
显示 更早的评论
Hi all. I have to solve a system of nonlinear equations many times for different parameters values. For example:
function F = root2d(x,a)
F(1) = exp(-exp(-x(1)+x(2))) - x(2)*(1+x(1)^2);
F(2) = x(1)*cos(x(2)) + x(2)*sin(x(1)) - a;
I would like to solve for a = [0 1]. So:
a = [0 1]
fun = @(x) root2d(x,a);
x0 = [0,0];
x = fsolve(fun,x0)
But this is not feasible because of the different dimension of a. Is there anyway to compute this without using loops for each value of a?. Thank you very much.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Systems of Nonlinear Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!