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
…