From 7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 Mon Sep 17 00:00:00 2001 From: prashantsinalkar Date: Tue, 10 Oct 2017 12:27:19 +0530 Subject: initial commit / add all books --- 413/CH1/EX1.4/Example_1.sce | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 413/CH1/EX1.4/Example_1.sce (limited to '413/CH1/EX1.4') diff --git a/413/CH1/EX1.4/Example_1.sce b/413/CH1/EX1.4/Example_1.sce new file mode 100644 index 000000000..b92d1239e --- /dev/null +++ b/413/CH1/EX1.4/Example_1.sce @@ -0,0 +1,14 @@ +clearglobal() +clc; +fx='x.^3+2*x.^2-x+5' +dfx='3*x.^2+4*x-1' +x0=2.5; +x = x0; fa=eval(fx); +tol=0.0000001 +while abs(fa)>tol +x = x0; fa=eval(fx); dfa=eval(dfx) +x1=x0-fa/dfa; + X = [x0,x1]; + disp(X) + x0=x1 + end; \ No newline at end of file -- cgit