interpoflagran - [C2,L]=lagran(x,y) polyval(C2,2)...

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

View Full Document Right Arrow Icon
%use quad lagran interp p2(x) on nodes x0, x1, x2 to approx f(2) and f(2.4) x=[nodes]; y=function given [C,L]=lagran(x,y) polyval(C,2) polyval(C,2.4) %use cubic lagran interp p3(x) on nodes xo,x1,x2,x3 to approx f(2) and %f(2.4) x=[nodes]; y=function given;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: [C2,L]=lagran(x,y) polyval(C2,2) polyval(C2,2.4) %plot p2x and p3x and original function on interval---x2=linspace(interval); y=function given; y0=polyval(C,x2); y2=polyval(C2,x2); plot(x2,y,x,y0,x,y2) legend('function','quad','cube')...
View Full Document

This note was uploaded on 09/11/2011 for the course MECH 231 taught by Professor Den during the Spring '11 term at Rutgers.

Ask a homework question - tutors are online