Bisection Method

clc;
clear all;
%Bisection Method
f1=input(‘Enter the equation:’,’s’);
f=inline(f1);
e1=input(‘Enter the first end:’);
e2=input(‘Enter the second end:’);
acc=input(‘Enter the accuracy:’);
disp(‘*****’);
m=(e1+e2)/2;
i=0;
while abs(f(m))>acc
i=1+i;
fprintf(‘%d)\t%f\tf(x)=%f\n’, i, m, f(m));
if(f(m)*f(e2))<0 e1=m; else e2=m; end m=(e1+e2)/2; end fprintf('%d)\t%f\tf(x)=%f\n',i,m,f(m)); disp('*****'); fprintf('The root of equation by bisection method=%f\n',m);

Print Friendly

Share this with your friends

2 Comments to “Bisection Method”

  1. I’m relaly into it, thanks for this great stuff!

  2. Hello,I log on to your blogs named “Bisection Method – My Softworks” regularly.Your writing style is witty, keep it up! And you can look our website about تحميل اغانى http://www.aghanyna.com/arabic/.

Leave a Reply

Your email address will not be published. Required fields are marked *