using fsolve when the function handle takes in 2 variables that are both vectors
Mostra commenti meno recenti
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);
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Solver Outputs and Iterative Display in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!