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);
Best Answer