brute2 - f counter=0 XL=a YL=feval(func,XL,y for i =...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
% % brute2 % % pass: % func, % a,b for interval, % delta is incremental step, % N is number of roots % y is additional variable % returns array with xi,yi being solution interval % function [apts,bpts] = brute2(func,a,b,delta,N,y)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: f counter=0; XL=a; YL=feval(func,XL,y); for i = a:delta:b XR = i; YR = feval(func,XR,y); if sign(YL) ~= sign(YR) counter = counter + 1; apts(counter) = XL; bpts(counter) = XR; end; if(counter >= N) break; end; end;...
View Full Document

This note was uploaded on 09/19/2009 for the course MATH numerical taught by Professor Ford during the Spring '09 term at FAU.

Ask a homework question - tutors are online