using fsolve when the function handle takes in 2 variables that are both vectors
Afficher commentaires plus anciens
I'm trying to solve system of non-linear equations. My function handle fun takes in 2 variables ( x and y) that are both vectors.Each vector has 2 components. I want fsolve to return me 2 vectors with 2 components each. However, fsolve can only return one vector. How do I find an appropriate solution for my problem? Any help appreciated.
fun=@(x,y) [exp(-exp(-(x+y))) - x.*(1+x.^2); x.*cos(y) + y.*sin(x) - [0.5;0.5]];
x0=[1;1]; % initial guess for x vector
y0=[0;1]; % initial guess for y vector
[result1,result2]=fsolve(fun,x0,y0);
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Conversion Between Symbolic and Numeric dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!