`Hey,
Note: If you have any queries related to the answer please do comment. I would be very happy to resolve all your queries.
1)
clc
clear all
close all
format long;
f=@(x) sin(x);
a=-pi;
b=pi;
n=100;
incsearch(f,a,b,n)
function B=incsearch(f,a,b,n)
x=linspace(a,b,n);
B=[];
c=0;
for i=1:length(x)-1
if(f(x(i))*f(x(i+1))<0)
B=[B;x(i) x(i+1)];
c=c+1;
end
end
disp('number of brackets');
disp(c);
end
Note: Brother According to Chegg's policy we are only allowed to answer first part if it is not a one word answer and there are many. So, I request you to post other part as separate posts
Kindly revert for any queries
Thanks.
Solve these commands by Matlab and send a clear pics plz LAB2 Finding roots of functions...