Advertisement
Guest User

Untitled

a guest
Sep 17th, 2014
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. alpha = 0.05;
  2. NM = @(x,f)x-alpha*prod(([1,0]*f([x,1;0,x])).^[1,-1]);
  3. f = @(x)32*x.^6-48*x.^4+18*x.^2-x.^0;
  4. x = 0.5;
  5. eps = 1;
  6. while eps > 1e-5
  7. xn = NM(x,f);
  8. eps = abs(xn-x)
  9. x = xn;
  10. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement