summaryrefslogtreecommitdiff
path: root/149/CH24/EX24.1
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /149/CH24/EX24.1
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '149/CH24/EX24.1')
-rwxr-xr-x149/CH24/EX24.1/ques1.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/149/CH24/EX24.1/ques1.sce b/149/CH24/EX24.1/ques1.sce
new file mode 100755
index 000000000..6c61d4967
--- /dev/null
+++ b/149/CH24/EX24.1/ques1.sce
@@ -0,0 +1,20 @@
+clc
+clear
+x=poly(0,'x');
+p=x^3-4*x-9
+disp("Finding roots of this equation by bisection method");
+disp('f(2) is -ve and f(3) is +ve so a root lies between 2 and 3');
+l=2;
+m=3;
+function y=f(x)
+ y=x^3-4*x-9;
+endfunction
+for i=1:4
+ k=1/2*(l+m);
+if(f(k)<0)
+ l=k;
+else
+ m=k;
+ end
+end
+disp(k)