Hi everyone,
How can I use the result of each iteration fsolve as the initial guess for other fsolve. My code is like that: The main file
if trueX0 = rho; % Make a starting guess at the solution
options = optimoptions('fsolve','Display','iter'); % Option to display output
[X,fval,exitflag,output] = fsolve(@eqDFT,X0,options); % Call solver
rho=X;endm -file for the first fsolveif truefunction F=eqDFT(X)Y0 = [alpha1 alpha2]; % Make a starting guess at the solutionoptions = optimoptions('fsolve','TolFun',1.e-12,'Display','iter'); % Option to display outputY = fsolve(@eqAlpha,Y0,options,X); % Call solver....endand the second fsolve @eqAlpha with Y variable and additionnal parameter X which is defined by rho like thatif true function G=eqAlpha(Y,rho) .... endend
Thank you so much for reading this question and give me some ideas about it.
Best Answer