summaryrefslogtreecommitdiff
path: root/243/CH11/EX11.1/11_01.sce
diff options
context:
space:
mode:
Diffstat (limited to '243/CH11/EX11.1/11_01.sce')
-rwxr-xr-x243/CH11/EX11.1/11_01.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/243/CH11/EX11.1/11_01.sce b/243/CH11/EX11.1/11_01.sce
new file mode 100755
index 000000000..6caabe4c7
--- /dev/null
+++ b/243/CH11/EX11.1/11_01.sce
@@ -0,0 +1,16 @@
+//Example No. 11_01
+//First order forward difference
+//Pg No. 348
+clear ;close ;clc ;
+
+x = poly(0,"x");
+deff('F = f(x)','F = x^2');
+deff('DF = df(x,h)','DF = (f(x+h)-f(x))/h');
+dfactual = derivat(f(x));
+h = [0.2 ; 0.1 ; 0.05 ; 0.01 ]
+for i = 1:4
+ y(i) = df(1,h(i));
+ err(i) = y(i) - horner(dfactual,1)
+end
+table = [h y err];
+disp(table)