spline3 - %Cubic spline with zero-slope clamped end...

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

View Full Document Right Arrow Icon
function spline3(x,y,z) %Problem 16.10 % Cubic spline with a not-a-knot end condtions gg=linspace(min(x),max(x),101); yy=interp1(x,y,gg,'spline'); plot(x,y,'o',gg,yy); title('(a) Cubic spline with a not-a-knot end condtions'); xlabel('x'); ylabel('f(x)'); a=spline(x,y,z); fprintf('\ny(%2.1f)=%6.4f\n',z,a); pause %-------------------------------------------------------
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: %Cubic spline with zero-slope clamped end conditions y2=[0 20 20 12 7 6 6 0]'; pp=spline(x,y2); yy=ppval(pp,gg); plot(x,y,'o',gg,yy); title('(b) Cubic spline with zero-slope clamped end condtions'); xlabel('x'); ylabel('f(x)'); a=spline(x,y2,z); fprintf('\ny(%2.1f)=%6.4f\n\n',z,a);...
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.

Ask a homework question - tutors are online