Advertisement
STANAANDREY

newton multivar

Mar 5th, 2023 (edited)
1,008
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.22 KB | None | 0 0
  1. F=@(x)[x(1)^2+4*x(2)^2-4; 4*x(1)^2+x(2)^2-4];
  2. DF=@(x)[2*x(1),8*x(2);8*x(1),2*x(2)];
  3. disp(newton(F, DF, [1; 1], 10))
  4.  
  5.  
  6. function x = newton(F,DF,x0,k)
  7.     x = x0;
  8.     for i=1:k
  9.         x = x - (DF(x))^-1*F(x);
  10.     end
  11. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement