summaryrefslogtreecommitdiff
path: root/1670/CH5/EX5.45/5_45.sce
diff options
context:
space:
mode:
Diffstat (limited to '1670/CH5/EX5.45/5_45.sce')
-rwxr-xr-x1670/CH5/EX5.45/5_45.sce21
1 files changed, 21 insertions, 0 deletions
diff --git a/1670/CH5/EX5.45/5_45.sce b/1670/CH5/EX5.45/5_45.sce
new file mode 100755
index 000000000..9cd8984df
--- /dev/null
+++ b/1670/CH5/EX5.45/5_45.sce
@@ -0,0 +1,21 @@
+//Example 5.45
+//Inverse Lagrange Method
+//Page no. 192
+clc;close;clear;
+
+x=[30,34,38,42];
+y=[-30,-13,3,18];
+P=0;
+y1=0;
+for k=0:3
+ p=1
+ for j=0:3
+ if(j~=k)
+ p=p*((y1-y(j+1))/(y(k+1)-y(j+1)))
+ end
+ end
+ printf('\n L%i(f) = %g\n',k,p)
+ p=p*x(k+1)
+ P=P+p;
+end
+disp(P,'Inverse Lagrange interpolation x=') \ No newline at end of file