Download the two Matlab files:
bisection.m
my_fun.m
You can key in your function into "my_fun.m" and run the bisection method by executing, e.g.,

>> bisection('my_fun',0,1,1e-2)

For more info on the function, execute

>> help bisection