summaryrefslogtreecommitdiff
path: root/3293/CH6/EX6.12/Ex6_12.sce
blob: f6d9393d9f9ed6b9f7f02cac9fc366d5bdae5d83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//page 210
//Example 6.12
clc;
clear;
close;
A = round(rand(3,3) * 10);
disp(A,'A = ');
disp('A transpose is:');
disp(A','A'' = ');
if A' == A then
    disp('Since, A'' = A, A is a symmetric matrix.');
else
    disp('Since, A'' is not equal to A, A is not a symmetric matrix.');
end
if A' == -A then
    disp('Since, A'' = -A, A is a skew-symmetric matrix.');
else
    disp('Since, A'' is not equal to -A, A is not a skew-symmetric matrix.');
end
A1 = 1/2*(A + A');
A2 = 1/2*(A - A');
disp('A can be expressed as sum of A1 and A2');
disp('i.e., A = A1 + A2');
disp(A1,'A1 = ');
disp(A2,'A2 = ');
disp(A1 + A2,'A1 + A2 = ');
//end