test mixed signals Using binary search method to develop a m
test mixed signals
Solution
myfunction = @(x) x.^9 + x - 1;
x_lower = 0;
x_upper = 1;
x_mid = (x_lower + x_upper)/2;
while abs(myfunction(x_mid)) > 0.00001
if(myfunction(x_mid)*myfunction(x_upper)) < 0
x_lower = x_mid;
else
x_upper = x_mid;
end
x_mid = (x_lower + x_upper)/2;
end
disp(x_mid);
Root is 0.8243.
![test mixed signals Using binary search method to develop a matlab code to figure out the one root between [0.1] for equation f(x) = x^9 + x- 1.Solutionmyfuncti test mixed signals Using binary search method to develop a matlab code to figure out the one root between [0.1] for equation f(x) = x^9 + x- 1.Solutionmyfuncti](/WebImages/23/test-mixed-signals-using-binary-search-method-to-develop-a-m-1055547-1761550640-0.webp)