1: Two ways to get a sequence
  Take bisection method for an example. 

a:
 
M = 1000;
TOL = 1.0e-4;
a = 1;
b = 2;
N = 1;
                                                                                                 
while (N < M)
                                                                                                 
p(N) = (b+a)/2.0;
FP = func4_1(p(N));
                                                                                                 
if (abs(FP) < TOL | (b-a)/2 < TOL)
display(p);
return;
end

FA = func4_1(a);
FB = func4_1(b);
                                                                                                 
if (FA*FP < 0)
b = p(N);
elseif (FB*FP < 0)
a = p(N);
end

N = N+1;
                                                                                                 
end
                                                                                                 
display('Method failed after 100 steps');

b:

M = 1000;
TOL = 1.0e-4;
a = 1;
b = 2;
N = 1;

fid = fopen('bisection.txt','w');
fprintf(fid,' N        aN            bN           pN\n');

                                                                                                 
while (N < M)
                                                                                                 
p = (b+a)/2.0;
FP = func4_1(p);
fprintf(fid,'%3d %12.8f %12.8f  %12.8f\n', N,a,b,p);
                                                                                                 
if (abs(FP) < TOL | (b-a)/2 < TOL)
fclose(fid);
display(p);
return;
end

FA = func4_1(a);
FB = func4_1(b);
                                                                                                 
if (FA*FP < 0)
b = p;
elseif (FB*FP < 0)
a = p;
end

N = N+1;
                                                                                                 
end
                                                                                                 
fclose(fid);
display('Method failed after 100 steps');


2: Implement secant method by yourself.
