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.

Réponses (0)

Catégories

Produits

Question posée :

le 4 Avr 2016

Community Treasure Hunt

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

Start Hunting!

Translated by