diff options
author | priyanka | 2015-06-24 15:03:17 +0530 |
---|---|---|
committer | priyanka | 2015-06-24 15:03:17 +0530 |
commit | b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch) | |
tree | ab291cffc65280e58ac82470ba63fbcca7805165 /149/CH24/EX24.4 | |
download | Scilab-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.4')
-rwxr-xr-x | 149/CH24/EX24.4/ques4.sce | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/149/CH24/EX24.4/ques4.sce b/149/CH24/EX24.4/ques4.sce new file mode 100755 index 000000000..2544a0e32 --- /dev/null +++ b/149/CH24/EX24.4/ques4.sce @@ -0,0 +1,25 @@ +//ques 2
+disp('f(x)=x*log(x)-1.2');
+function y=f(x)
+ y=x*log10(x)-1.2;
+endfunction
+
+disp('we are required to find the roots of f(x) by the method of false position');
+disp('f(2)=-ve and f(3)=+ve so s root lie between 2 and 3');
+disp('finding the roots by false position method');
+
+l=2;
+m=3;
+for i=1:3
+ k=l-(m-l)*f(l)/(f(m)-f(l));
+ if(f(k)<0)
+ l=k;
+ else
+ m=k;
+ end
+end
+//fprintf('The roots of the equation is %g',k)
+disp('The root of the equation is :');
+disp(k);
+
+
\ No newline at end of file |