summaryrefslogtreecommitdiff
path: root/260/CH10/EX10.7/10_7.sce
diff options
context:
space:
mode:
Diffstat (limited to '260/CH10/EX10.7/10_7.sce')
-rw-r--r--260/CH10/EX10.7/10_7.sce19
1 files changed, 19 insertions, 0 deletions
diff --git a/260/CH10/EX10.7/10_7.sce b/260/CH10/EX10.7/10_7.sce
new file mode 100644
index 000000000..1062655ac
--- /dev/null
+++ b/260/CH10/EX10.7/10_7.sce
@@ -0,0 +1,19 @@
+//Eg-10.7
+//pg-442
+
+clear
+clc
+close()
+
+x = [0;2;5];
+y = [0;2.5;6.9];
+
+exec lagrange.sci
+
+p = lagrange(x,y,2)
+
+printf('The polynomial is \n')
+disp(p)
+k = horner(p,3)
+
+printf('\nThe value of the polynomial at x = 3 is %f\n',k) \ No newline at end of file