diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /964/CH18/EX18.2/18_2.sce | |
download | Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2 Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip |
initial commit / add all books
Diffstat (limited to '964/CH18/EX18.2/18_2.sce')
-rwxr-xr-x | 964/CH18/EX18.2/18_2.sce | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/964/CH18/EX18.2/18_2.sce b/964/CH18/EX18.2/18_2.sce new file mode 100755 index 000000000..c756ff3d6 --- /dev/null +++ b/964/CH18/EX18.2/18_2.sce @@ -0,0 +1,19 @@ +//clc()
+x = 2;
+x0 = 1;
+m = 0;
+x1 = 4;
+n = 1.386294;
+x2 = 6;
+p = 1.791759;
+b0 = m;
+b1 = (n - m)/(x1 - x0);
+b2 = ((p - n)/(x2 - x1) - (n - m)/(x1 - x0))/(x2 - x0);
+disp(b0,"b0 = ")
+disp(b1,"b1 = ")
+disp(b2,"b2 = ")
+f = b0 + b1*(x - x0) + b2*(x - x0)*(x - x1);
+disp(f,"f(2) = ")
+r = log(2);
+e = (r -f)*100/r;
+disp("%",e,"error = ")
|