brute - YL=feval(func,XL); for i = a:delta:b XR = i; YR =...

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

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

Unformatted text preview: YL=feval(func,XL); for i = a:delta:b XR = i; YR = feval(func,XR); if sign(YL) ~= sign(YR) counter = counter + 1; apts(counter) = XL; bpts(counter) = XR; end; if(counter >= N) break; end; XL = XR; YL = YR; 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