Advertisement
Guest User

Untitled

a guest
Feb 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. % Fonction utilisant la méthode de la bissection afin de trouver la racine
  2. % de la fonction
  3.  
  4. racine = bissection (f,x0,x1,precision)
  5.  
  6. % Déclaration des différentes variables
  7.  
  8. text ='Mauvaises conditions initiales';
  9. x3;
  10. milieu=0;
  11.  
  12. % Vérification des valeurs initiales
  13.  
  14. if ((x0<0 && x1<0) || (x0>0 && x1>0) || (x0==x1))
  15. disp(text);
  16.  
  17. else
  18. if (x0>x1)
  19. x3=x0;
  20. x0=x1;
  21. x1=x3;
  22.  
  23. while ( )
  24. milieu= (x0+x1)/2;
  25. if f(milieu)>0
  26. x1=milieu;
  27. else
  28. x0=milieu;
  29. end
  30. end
  31. end
  32. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement