summaryrefslogtreecommitdiff
path: root/243/CH6/EX6.3
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /243/CH6/EX6.3
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 '243/CH6/EX6.3')
-rwxr-xr-x243/CH6/EX6.3/6_03.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/243/CH6/EX6.3/6_03.sce b/243/CH6/EX6.3/6_03.sce
new file mode 100755
index 000000000..9eeb63185
--- /dev/null
+++ b/243/CH6/EX6.3/6_03.sce
@@ -0,0 +1,16 @@
+//Example No. 6_03
+//Evaluating Polynomial using Horner's rule
+//Pg No.
+clear ; close ; clc ;
+
+//Coefficients of x terms in the increasing order of power
+A = [ 6 ; 1 ; -4 ; 1];
+x = 2
+[n,c] = size(A) ;
+p(n) = A(n)
+disp(p(n), 'p(4) = ')
+for i = 1:n-1
+ p(n-i) = p(n-i+1)*x + A(n-i)
+ printf('\n p(%i)= %i\n',n-i,p(n-i))
+end
+mprintf('\n f(%i) = p(1) = %i',x,p(1)) \ No newline at end of file