Using fsolve with vector as argument
Ältere Kommentare anzeigen
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.
Antworten (0)
Kategorien
Mehr zu Systems of Nonlinear Equations finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!