function [xsol1,xsol2]= NewRaph2(F1,F2,F11,F22,F12,F21,x1i,x2i,iter,Err)%F1 et F2 représentent 2 équations de départ
%F11 et F22 sont des dérivées premières
%F12, F21 sont des dérivées croisées
%x1i et x2i représentent 2 valeurs initiales correspondant x1 et x2
%iter est nombre d'itérations
%Err est l'erreur relative
%xsol1 et xsol2 correspondent aux valeurs de x1 et x2
F1= @(x1,x2) 4*x1^2-x2^3+28;F2= @(x1,x2) 3*x1^3+4*x2^2-145;F11= @(x1,x2) 8*x1;F22= @(x1,x2) 8*x2;F12= @(x1,x2) -3*x2^2;F21= @(x1,x2) 9*x1^2;for j=1:iter A=F11(x1i,x2i)*F22(x1i,x2i)-F21(x1i,x2i)*F12(x1i,x2i); deltax1=(-F1(x1i,x2i)*F22(x1i,x2i)+F2(x1i,x2i)*F12(x1i,x2i))/A; deltax2=(-F2(x1i,x2i)*F11(x1i,x2i)+F1(x1i,x2i)*F21(x1i,x2i))/A; x1=x1i+deltax1; x2=x2i+deltax2; Errx1=abs((x1-x1i)/x1i); Errx2=abs((x2-x2i)/x2i); if Errx1 < Err && Errx2 , Err; xsol1=x1; xsol2=x2; break else x1i=x1; x2i=x2; endend
It is saying that Output argument 'xsol1' is not assigned on some execution paths.
How can I resolve this problem? Thank you
Best Answer