MATLAB Project 3.1
The m-file is
U=round(20*rand(4))-10
V=round(10*rand(4))
b=ones(4,1)
rankofU=rank(U)
rankofV=rank(V)
TEtoS=U
TStoE=inv(U)
TFtoS=V
TStoF=inv(V)
c=TStoE*b
TEtoS*c
d=TStoF*b
TFtoS*d
TEtoF=TStoF*TEtoS
TFtoE=TStoE*TFtoS
TFtoE*d-c
TEtoF*c-d
When the m-file is
executed it yields
U =
-1
7 7 7
9
1 -10 0
-1
-6 4 4
-2
3 -2 -1
V =
3
3 4 5
2
5 9 9
2
2 9 8
7
7 6 6
b =
1
1
1
1
a) It is improbable that U is singular and so we expect the rank to be 4:
rankofU =
4
rankofV =
4
TEtoS =
-1
7 7 7
9
1 -10 0
-1
-6 4 4
-2
3 -2 -1
TStoE is of course the inverse of TEtoS and TStoF is the inverse of TFtoS:
TStoE =
0.0249
0.0312 -0.1215 -0.3115
0.0561
-0.0013 -0.0948 0.0134
0.0280
-0.0721 -0.1188 -0.2790
0.0623
0.0779 0.1963 0.2212
TFtoS =
3
3 4 5
2
5 9 9
2
2 9 8
7
7 6 6
TStoF =
0.1803
-0.3333 0.1803 0.1093
-0.2787 0.3333 -0.2787 0.1038
-0.7213 0 0.2787 0.2295
0.8361 0 -0.1639 -0.3115
c =
-0.3769
-0.0267
-0.4419
0.5576
ans =
1.0000
1.0000
1.0000
1.0000
b) So b=Uc
d =
0.1366
-0.1202
-0.2131
0.3607
ans =
1.0000
1.0000
1.0000
1.0000
c) So b=Vd
d) S=
TEtoF =
-3.5792
0.1749 5.0984 1.8743
3.3497
0.3661 -6.6066 -3.1694
-0.0164
-6.0328 -4.3934 -4.1639
-0.0492
5.9016 5.8197 5.5082
T=
TFtoE =
-2.2866
-2.1931 -2.5826 -2.4361
0.0694
0.0654 -0.5607 -0.4099
-2.2510
-2.4673 -3.2804 -3.1335
2.2835
2.5171 4.0436 3.9097
We compute Td-c :
ans =
1.0e-015 *
0.2220
-0.0104
0.3331
-0.1110
and we compute Sc-d :
ans =
1.0e-014 *
-0.0472
0.0583
0.0833
-0.1332
and we see that these differences are zero to within roundoff error.