Chapter 3 Interpolation and Polynomial Approximation

Post on 09-Jan-2016

143 views 8 download

Tags:

description

Chapter 3 Interpolation and Polynomial Approximation. 4.3 Lagrange Approximation. 1.3.1 Error Terms and Error Bounds. 1.3.2 Comparison of Accuracy and O(h N+1 ). function [C,L]=lagran(X,Y) w=length(X); n=w-1; L=zeros(w,w); for k=1:n+1 V=1; for j=1:n+1 if k~=j - PowerPoint PPT Presentation

Transcript of Chapter 3 Interpolation and Polynomial Approximation

Chapter 3 Interpolation and Polynomial Approximation

4.3 Lagrange Approximation

1.3.1 Error Terms and Error Bounds

1.3.2 Comparison of Accuracy and O(hN+1)

function [C,L]=lagran(X,Y)w=length(X);n=w-1;L=zeros(w,w);for k=1:n+1 V=1; for j=1:n+1 if k~=j V=conv(V,poly(X(j)))/(X(k)-X(j)); end end L(k,:)=V;endC=Y*L;