summaryrefslogtreecommitdiff
path: root/260/CH5/EX5.4
diff options
context:
space:
mode:
authorprashantsinalkar2017-10-10 12:27:19 +0530
committerprashantsinalkar2017-10-10 12:27:19 +0530
commit7f60ea012dd2524dae921a2a35adbf7ef21f2bb6 (patch)
treedbb9e3ddb5fc829e7c5c7e6be99b2c4ba356132c /260/CH5/EX5.4
parentb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (diff)
downloadScilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.gz
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.tar.bz2
Scilab-TBC-Uploads-7f60ea012dd2524dae921a2a35adbf7ef21f2bb6.zip
initial commit / add all books
Diffstat (limited to '260/CH5/EX5.4')
-rw-r--r--260/CH5/EX5.4/5_4.sce37
1 files changed, 37 insertions, 0 deletions
diff --git a/260/CH5/EX5.4/5_4.sce b/260/CH5/EX5.4/5_4.sce
new file mode 100644
index 000000000..2abbf2796
--- /dev/null
+++ b/260/CH5/EX5.4/5_4.sce
@@ -0,0 +1,37 @@
+//Eg-5.4
+//pg-219
+
+clear
+clc
+
+exec graf.sci
+clc
+A=[1 2 4;3 1 2;4 2 5];
+
+a1=zeros(3,1);
+a1(1)=trace(A);
+A1=A;
+
+for k=2:3
+ A2=A*(A1-a1(k-1)*eye(3,3));
+ a1(k)=trace(A2)/k;
+ A1=A2;
+end
+
+C=[1; -a1];
+
+for(i = 1:4)
+ c(i) = C(5-i);
+end
+
+ce = poly(c,'x','c');
+
+printf('\nThe expression of the characteristic equation is \n')
+
+disp(ce)
+printf('\n')
+for(i = 1:4)
+ G(1,i) = c(5-i);
+end
+
+q = graf(G,0.001); \ No newline at end of file