prog3c_2533_sp11

prog3c_2533_sp11 - cderiv2=polyder(cderiv1);...

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

View Full Document Right Arrow Icon
% CSC 2533 % Spring 2011 % Assignment 3c [xd yd]=textread('prog3c.dat'); n=length(xd); for(k=2:n-1) xd3=[xd(k-1) xd(k) xd(k+1)]; yd3=[yd(k-1) yd(k) yd(k+1)]; c2=polyfit(xd3,yd3,2); cderiv1=polyder(c2); deriv1=polyval(cderiv1,xd(k));
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cderiv2=polyder(cderiv1); deriv2=polyval(cderiv2,xd(k)); fprintf('x=%.1f 1st derivative=%8.5f 2nd derivative=%9.5f\n', . .. xd(k),deriv1,deriv2); end e...
View Full Document

Ask a homework question - tutors are online