summaryrefslogtreecommitdiff
path: root/75/CH5/EX5.4/ex_4.sce
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:38:01 +0530
committerprashantsinalkar2017-10-10 12:38:01 +0530
commitf35ea80659b6a49d1bb2ce1d7d002583f3f40947 (patch)
treeeb72842d800ac1233e9d890e020eac5fd41b0b1b /75/CH5/EX5.4/ex_4.sce
parent7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (diff)
downloadScilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.gz
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.tar.bz2
Scilab-TBC-Uploads-f35ea80659b6a49d1bb2ce1d7d002583f3f40947.zip
updated the code
Diffstat (limited to '75/CH5/EX5.4/ex_4.sce')
-rwxr-xr-x75/CH5/EX5.4/ex_4.sce6
1 files changed, 3 insertions, 3 deletions
diff --git a/75/CH5/EX5.4/ex_4.sce b/75/CH5/EX5.4/ex_4.sce
index d14b592d2..d661f5067 100755
--- a/75/CH5/EX5.4/ex_4.sce
+++ b/75/CH5/EX5.4/ex_4.sce
@@ -1,4 +1,4 @@
- // PG (258)
+// PG (258)
deff('[y]=f(x)','y=exp(x)*cos(x)')
x0=0;
@@ -7,7 +7,7 @@ x=x0:xn;
// True value
-I = integrate('exp(x)*cos(x)','x',x0,x1)
+I = integrate('exp(x)*cos(x)','x',x0,xn)
// Using Simpson's rule
@@ -35,4 +35,4 @@ x5=x0+5*h;
x6=x0+6*h;
x7=x0+7*h;
x8=x0+8*h;
- I3 = h*(f(x0)+4*f(x1)+2*f(x2)+4*f(x3)+2*f(x4)+4*f(x5)+2*f(x6)+4*f(x7)+f(x8))/3
+ I3 = h*(f(x0)+4*f(x1)+2*f(x2)+4*f(x3)+2*f(x4)+4*f(x5)+2*f(x6)+4*f(x7)+f(x8))/3 \ No newline at end of file