Question: Identify the limitations of the algorithm above. B . Study the function code given and answer the questions that follow. function [ root , f

Identify the limitations of the algorithm above.
B. Study the function code given and answer the questions that follow.
function [root,fx, ea, iter]=bisect (func, xl, xu, es, maxit, varargin)
if nargin 3, 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|1isempty(es), es=0.0001; end
if nargin5||isempty (maxit), maxit=50; end
iter =0;xr=xl; ea =100;
while (1)
xrold=xr;
xr=x1+xu2;
iter = iter +1 ;
if xr=0, ea ?a=bs(xr-xroldxr)**100; end
test = func (x),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
root =xr;fx=func(xr,varargin{?);
What does this function?
Look up the MATLAB function vararg in 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?
if line 16 is true, which interval odds represented by line 17?
In line 10 what does variabale xr represent?
In the functionn script above, what are the conditions for the loop termination? Explain
 Identify the limitations of the algorithm above. B. Study the function

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!