From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 1673/CH3/EX3.14/3_14.sce | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 1673/CH3/EX3.14/3_14.sce (limited to '1673/CH3/EX3.14/3_14.sce') diff --git a/1673/CH3/EX3.14/3_14.sce b/1673/CH3/EX3.14/3_14.sce new file mode 100755 index 000000000..abc816f29 --- /dev/null +++ b/1673/CH3/EX3.14/3_14.sce @@ -0,0 +1,20 @@ +//example 3.14 +//lagrange's interpolation formula +//page 105 +clc;clear;close; +y=[4 12 19]; +x=[1 3 4]; +y_x=7; +Y_X=0; +poly(0,'y'); +for i=1:3 + p=x(i); + for j=1:3 + if i~=j then + p=p*((y_x-y(j) )/( y(i)-y(j))) + end + end + Y_X=Y_X+p; + end +disp(Y_X,'Y_X='); + \ No newline at end of file -- cgit