summaryrefslogtreecommitdiff
path: root/50/CH4/EX4.21
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /50/CH4/EX4.21
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '50/CH4/EX4.21')
-rwxr-xr-x50/CH4/EX4.21/ex_4_21.sce17
1 files changed, 17 insertions, 0 deletions
diff --git a/50/CH4/EX4.21/ex_4_21.sce b/50/CH4/EX4.21/ex_4_21.sce
new file mode 100755
index 000000000..288cd93e5
--- /dev/null
+++ b/50/CH4/EX4.21/ex_4_21.sce
@@ -0,0 +1,17 @@
+// example: 4.21;
+// piecewise linear interpolating polinomials:
+
+x1=1;x2=2; x3=4;x4=8;
+f1=3; f2=7; f3=21; f4=73;
+// we need to apply legranges interpolation in sub-ranges [1,2];[2,4],[4,8];
+
+ x=poly(0,"x");
+
+P1=legrangeinterpol (x1,x2,f1,f2); // in the range [1,2]
+P1
+
+P1=legrangeinterpol (x2,x3,f2,f3); // in the range [2,4]
+P1
+
+P1=legrangeinterpol (x3,x4,f3,f4); // in the range [4,8]
+P1 \ No newline at end of file