Advertisement
STANAANDREY

broyden1

Mar 6th, 2023 (edited)
1,519
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.28 KB | None | 0 0
  1. function x = broyden1(F,x0,k)
  2.     n = length(x0);
  3.     A = eye(n);
  4.     for i=1:k
  5.        x = x0 - (A)^-1*F(x0);
  6.        delta = x - x0;
  7.        Delta = F(x) - F(x0);
  8.        A = A + (Delta - A * delta) * delta'/(delta' * delta);
  9.        x0 = x;
  10.     end
  11. end
  12.  
  13. %carefull at k(not too big)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement