This preview shows page 1. Sign up to view the full content.
Unformatted text preview: %pp = mkpp(breaks,coefs) builds a piecewise polynomial pp from its breaks %and coefficients. breaks is a vector of length L+1 with strictly increasing %elements which represent the start and end of each of L intervals. coefs is %an L-by-k matrix with each row coefs(i,:) containing the coefficients of %the terms, from highest to lowest exponent, of the order k polynomial on %the interval [breaks(i),breaks(i+1)]. T=pp.coefs; Coefs=[3*T(:,1),2*T(:,2),1*T(:,3)]; P=mkpp(pp.breaks,Coefs); %v = ppval(pp,xx) returns the value of the piecewise polynomial f, %contained in pp, at the entries of xx. gg2=ppval(z,P); fprintf('\nTrue derivative values=\n') fprintf('%5.4f\n',gg1) fprintf('\nSpline fit derivative values=\n') fprintf('%5.4f\n',gg2)...
View Full Document
This note was uploaded on 09/27/2011 for the course EGM 3344 taught by Professor Raphaelhaftka during the Spring '09 term at University of Florida.
- Spring '09