f1=@ (x,y) x+2*x*y-15;f2=@ (x,y) x*y+3*x^2*y-10;a=@ (x,y) 1+2*y;b=@ (x,y) 2*x;c=@ (x,y) y+6*x*y;d=@ (x,y) x+3*x^2;x(1)=1.5; y(1)=2.5; N=2;for i=1:NJ=[a(x(i),y(i)) ,b(x(i),y(i)); c(x(i),y(i)) ,d(x(i),y(i))];x(i+1)=x(i)-((f1(x(i),y(i))*d(x(i),y(i)))-(f2(x(i),y(i))*b(x(i),y(i))))/det(J);end
[SL: in the future, to make your code easier to read, please select the code then press the {}Code button above the edit box. I've applied that formatting for this post.]
Best Answer