Question: B . Study the function code given and answer the questions that follow. function [ root , f x , e a , iter ]

B. Study the function code given and answer the questions that follow.
function [root,fx,ea,iter ] bisect (func,x1,xu, es, maxit, varargin)
If nargin3, error('at least 3 input arguments required'), end
test =func(x1,varargin{?)***func(xu,varargin{?);
if test>0, error ('no sign change'), end
If nargin4||isempty(es), es=0.0001; end
if nargin5||isempty(maxit), maxit=50; end
iter =0;r=1; ea =100;
while (1)
xrold=xr;
xr=xl+xu2;
iter = iter +1 ;
if xr=0, ea ?a=bs(xr-xroldxr)***100; end
test =func(xl,varargin{?)***func(xr,varargin{?);
if test 0
xu=xr;
elseif test >0
xl=xr;
else
ea=0;
end
if ea =es || iter >= maxit, break, end
end
x2=r;fx=func(xr,varargin{?);
What does this function?
Look up the MATLAB function varargin employed in the function script above. What is varargin and what is it used for?
What are the default values for es and maxit in the function call below?
>val=bisect( func ,xl,xu)
If line 14 is true, which interval is represented by line 15?
 B. Study the function code given 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!