# brutes - S(j,4-y for i = a:delta:b XR = i YR =...

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

function [apts,bpts] = brutes(S,x_pts,j,delta,N,y) % Derek Rampal % brutes % % pass: % S matrix, Xvalues, j is spline row in S matrix, y is value to solve for % delta is incremental step, % N is number of roots % returns array with xi,yi being solution interval % a = x_pts(j,1); b = x_pts(j+1,1); counter=0; XL = a; YL = S(j,1)*(XL-x_pts(j,1))^3+S(j,2)*(XL-x_pts(j,1))^2+S(j,3)*(XL-x_pts(j,1))
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: +S(j,4)-y; for i = a:delta:b XR = i; YR = S(j,1)*(XR-x_pts(j,1))^3+S(j,2)*(XR-x_pts(j,1))^2+S(j,3)*(XR-x_pts(j,1)) +S(j,4)-y; 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; if(counter==0) apts(1)=0; bpts(1)=0; 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