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

LAB 3
A. Study the code given below and answer the questions that follow:
function xb= incsearch (func, xmin,xmax,ns)
if nargin 3, error('at least 3 arguments required'), end
if nargin 4,ns=50; end
x= linspace (xmin, xmax,ns);
f=func(x);
nb=0;xb=[];
for k=1 : length (x)-1
if )
b=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 followins function called is made?
what value of n s 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?
 LAB 3 A. Study the code given below and answer the

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!