Usage example for bisection related to Exercise 4.7
0001 % Usage example for bisection 0002 % related to Exercise 4.7 0003 0004 pt = 2; 0005 K = 1; 0006 f = @(x) x/(1-x) * sqrt(2*pt/(2+x)) - K; 0007 a = 0; 0008 b = 0.9; 0009 tol = 1e-6; 0010 max = 100; 0011 [ x,k ] = bisection( f,a,b,tol,max )