Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Fonction utilisant la méthode de la bissection afin de trouver la racine
- % de la fonction
- racine = bissection (f,x0,x1,precision)
- % Déclaration des différentes variables
- text ='Mauvaises conditions initiales';
- x3;
- milieu=0;
- % Vérification des valeurs initiales
- if ((x0<0 && x1<0) || (x0>0 && x1>0) || (x0==x1))
- disp(text);
- else
- if (x0>x1)
- x3=x0;
- x0=x1;
- x1=x3;
- while ( )
- milieu= (x0+x1)/2;
- if f(milieu)>0
- x1=milieu;
- else
- x0=milieu;
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement