From b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b Mon Sep 17 00:00:00 2001 From: priyanka Date: Wed, 24 Jun 2015 15:03:17 +0530 Subject: initial commit / add all books --- 149/CH24/EX24.6/ques7.sce | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 149/CH24/EX24.6/ques7.sce (limited to '149/CH24/EX24.6') diff --git a/149/CH24/EX24.6/ques7.sce b/149/CH24/EX24.6/ques7.sce new file mode 100755 index 000000000..b117f3f66 --- /dev/null +++ b/149/CH24/EX24.6/ques7.sce @@ -0,0 +1,20 @@ +//ques 7 +clear +clc +disp('To find squareroot of 28 by newtons method let x=sqrt(28) ie x^2-28=0'); +function y=f(x) + y=x^2-28; +endfunction +disp(' To find the roots by newtons method '); +disp('f(5)=-ve and f(6) is +ve so a root lies between 5 and 6'); +l=5; +m=6; +disp('let us take x0=5.5'); +disp("Root is given by rn=xn-f(xn)/der(f(xn)) "); +disp('approximated root in each steps are'); +x0=5.5; +for i=1:4 + k=x0-f(x0)/derivative(f,x0); + disp(k); + x0=k; +end \ No newline at end of file -- cgit