Question: A . Study the code given below and answer the questions that follow: function x b = incsearch ( func , x min, xmax, n

A. Study the code given below and answer the questions that follow:
function xb= incsearch (func,x min, xmax,ns)
if nargin 3, error('at least 3 arguments required'), end
if nargin 4,ns=50; end
x= linspace (xmin,x max, ns);
f= func (x);
nb=0;xb=[];
for k=1 : length (x)-1
if sign(f(k))=sign(f(k+1))
nb=nb+1;
xb(nb,1)=x(k);
xb(nb,2)=x(k+1);
end
end
if isempty (xb)
disp('no brackets found')
disp('check interval or increase ns')
else
disp('number of brackets:')
disp (nb)
end
What does this function do?
Look up the MATLAB function nargin. What value is returned by nargin if the following function called is made?what value of ns was utilized in the function call above?What does k represent? Check lines 7,8,10, and 11.What function syntax can be used to pass func to incsearch?For each iteration, what is the size of xb ?
 A. Study the code given below and answer the questions that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!