BWindow - f function [a,b] = BWindow(x,y,foundRoots) % % %...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
function [a,b] = BWindow(x,y,foundRoots) f % x and y are row vectors having length n. % The components of x satisfy x(1) < . .. < x(n) % foundRoots is a row m-vector, possibly empty. % After closing all figure windows, this function opens up a new figure % window and % (a) Draws a bisection window based on x and y. % (b) Plots y versus x and the points (foundRoots(k),0), k=1:m. % (c) Solicits a mouseclick. % (d) Returns the x and y coordinates of the mouseclick in a and b. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Close All % Close any open figure windows C n = length(x); % x is a length n vector n m = length(foundRoots); % length of vector foundRoots is m m % Key Quantities. . % %%%%%%%%%%%%%%%% % xMin = x(1); % First element of x vector x xMax = x(n); % Last element of x vector x xInterval = xMax - xMin; x L = xMin + (1/4)*(xInterval); %L L R = xMin + (3/4)*(xInterval); %R R yMax = max(abs(y)); y yMin = -yMax; y delx = (xMax-xMin)/20; d
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

BWindow - f function [a,b] = BWindow(x,y,foundRoots) % % %...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online