Advertisement
Minzjustcmonffs

Untitled

Jun 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. function[alpha,erreur,niter] =poinfixe(g,x0,itmax,eps)
  2. title = 'iteration roots eroors';
  3. line = '------------------------------------------------------------';
  4. fprintf('%s\n',title);
  5. fprintf('%s\n',line);
  6. alpha =x0;
  7. for niter =1:itmax
  8. x = alpha;
  9. alpha=g(x);
  10. erreur=abs(alpha-x);
  11. fprintf('%.f . %.5f %.5f \n',niter,alpha,erreur);
  12. if erreur<eps
  13. return
  14. end;
  15. fprintf('%s\n',line)
  16. end
  17. fprintf('%s\n',line)
  18. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement