summaryrefslogtreecommitdiff
path: root/191/CH6/EX6.1
diff options
context:
space:
mode:
Diffstat (limited to '191/CH6/EX6.1')
-rwxr-xr-x191/CH6/EX6.1/Example6_1.sce36
1 files changed, 18 insertions, 18 deletions
diff --git a/191/CH6/EX6.1/Example6_1.sce b/191/CH6/EX6.1/Example6_1.sce
index 56f64a982..7ec725bea 100755
--- a/191/CH6/EX6.1/Example6_1.sce
+++ b/191/CH6/EX6.1/Example6_1.sce
@@ -1,19 +1,19 @@
-//Numerical Differentiation
-clc;
-clear;
-close();
-format('v',9);
-deff('[y]=f(x)','y=exp(-x)');
-
-x0 = ones(:,8);
-h = [1 .2 .1 .02 .01 .002 .001 .0002];
-x1 = 1+h;
-f0 = f(x0);
-f1 = f(x1);
-dif = (f1-f0)./h;
-max_trun_err = exp(-1).*h/2;
-act_err = abs(- exp(-1)-dif);
-answer = [h' f0' f1' dif' max_trun_err' act_err'];
-disp(answer,' h f0 f1 f1-f0/h he^-1 |Actual Error|');
-x = (0:.0002:3);
+//Numerical Differentiation
+clc;
+clear;
+close();
+format('v',9);
+deff('[y]=f(x)','y=exp(-x)');
+
+x0 = ones(1,8);
+h = [1 .2 .1 .02 .01 .002 .001 .0002];
+x1 = 1+h;
+f0 = f(x0);
+f1 = f(x1);
+dif = (f1-f0)./h;
+max_trun_err = exp(-1).*h/2;
+act_err = abs(- exp(-1)-dif);
+answer = [h' f0' f1' dif' max_trun_err' act_err'];
+disp(answer,' h f0 f1 f1-f0/h he^-1 |Actual Error|');
+x = (0:.0002:3);
plot(x,f(x)); \ No newline at end of file