summaryrefslogtreecommitdiff
path: root/3293/CH6/EX6.5/Ex6_5.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /3293/CH6/EX6.5/Ex6_5.sce
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 '3293/CH6/EX6.5/Ex6_5.sce')
-rwxr-xr-x3293/CH6/EX6.5/Ex6_5.sce20
1 files changed, 20 insertions, 0 deletions
diff --git a/3293/CH6/EX6.5/Ex6_5.sce b/3293/CH6/EX6.5/Ex6_5.sce
new file mode 100755
index 000000000..2e0dc64c1
--- /dev/null
+++ b/3293/CH6/EX6.5/Ex6_5.sce
@@ -0,0 +1,20 @@
+//page 197
+//Example 6.5
+clc;
+clear;
+close;
+A = [0 1 0 1;1 0 1 0;0 1 0 1;1 0 1 0];
+disp(A,'A = ');
+disp('Computing powers on A:');
+disp(A*A,'A^2 = ');
+disp(A*A*A,'A^3 = ');
+deff('[p] = p(x)','p = x^3 - 4*x');
+disp('if p = x^3 - 4x, then');
+disp(p(A),'p(A) = ');
+x = poly(0,"x");
+f = x^3 - 4*x;
+disp(f,'Minimal polynomial for A is: ');
+disp(roots(f),'Characteristic values for A are:');
+disp(rank(A),'Rank(A) = ');
+disp(round(poly(A,"x")),'So, from theorem 2, characteristic polynomial for A is:');
+//end