Using fsolve with vector as argument
Afficher commentaires plus anciens
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.
Réponses (0)
Catégories
En savoir plus sur Systems of Nonlinear Equations dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!