MATLAB help required function root
- by programmeur
Dear All, 
I have made an program,
function bisection;
x1=input('enter the first value=')
x2=input('enter the second value=')
%f3=[];
for x=1:20
    %x=1;
       x3=(x1+x2)/2;
    while x3-x1 >= 0.001
    f3(x)=x3^3 + x3^2 - 3*x3 - 3;
    f1(x)=x1^3 + x1^2 - 3*x1 - 3;
    if ((f3(x)*f1(x)) < 0)
    x2=x3;
    else
     x1=x3;
    end   
    break
 end
 format long
 f3'
 disp('The root is found to be =');
 x3
end
.
.
.
.
.
program calculate function of interval (x1, x2) given by user,
my program compile and execute but little stupid repetition until for loop complete, i want to stop further printing loop when desired value is achieved with while condition is used.