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/CH21/EX21.7 | |
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/CH21/EX21.7')
-rwxr-xr-x | 964/CH21/EX21.7/21_7.sce | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/964/CH21/EX21.7/21_7.sce b/964/CH21/EX21.7/21_7.sce new file mode 100755 index 000000000..82bc6b812 --- /dev/null +++ b/964/CH21/EX21.7/21_7.sce @@ -0,0 +1,19 @@ +clc;
+clear;
+function y=f(x)
+ y=(0.2+25*x-200*x^2+675*x^3-900*x^4+400*x^5)
+endfunction
+tval=1.640533;
+x=[0 0.12 0.22 0.32 0.36 0.4 0.44 0.54 0.64 0.7 0.8];
+for i=1:11
+ func(i)=f(x(i));
+end
+l=0;
+for i=1:10
+ l=l+(x(i+1)-x(i))*(func(i)+func(i+1))/2;
+end
+disp(l,"l=")
+Et=tval-l;//error
+et=Et*100/tval;//percent relative error
+disp(Et,"The Error Et=")
+disp("%",et,"The percent relative error et=")
|