`Hey,
Note: Brother if you have any queries related the answer please do comment. I would be very happy to resolve all your queries.
clc%clears screen
clear all%clears history
close all%closes all files
format long
f=@(x) x.^5-5*x.^4+x.^3-6*x.^2-7*x+10;
R=findroots(-2:0.1:6,f,1e-5)
disp('Roots using roots command is');
roots([1,-5,1,-6,-7,10])
function R=findroots(x,f,tol)
R=[];
a=x(1);
count=1;
for kk=1:length(x)
if(f(a)*f(x(kk))<0)
b=x(kk);
iter = 0;
if f(a)*f(b)>=0
disp('No Root')
else
prev = (a+b)/2;
p=a;
while (abs(f(p))>tol)
prev=p;
iter =iter+ 1;
p = (a+b)/2;
if f(p) == 0
break;
end
if f(a)*f(p)<0
b = p;
else
a = p;
end
if(iter==100)
disp('the required accuracy is not reached in 50
iterations');
end
end
end
R(count)=p;
count=count+1;
a=x(kk);
else
a=x(kk);
end
end
end

Kindly revert for any queries
Thanks.
number 3 Huu um poucou UL ue selat Method . Solve with Io = 0.5 to...