
329Matrices and Linear Algebra
As another example multiply 3M, where M is the following matrix M =
> M <- structure(1:6, dim=c(3,2) )
> M
[,1] [,2]
[1,] 1 4
[2,] 2 5
[3,] 3 6
> 3*M
[,1] [,2]
[1,] 3 12
[2,] 6 15
[3,] 9 18>
Calculate A
3
where matrix A is
A =
−
−
17 6
45 16
. First, generate the matrix
> A <- matrix(c(17,−6,45,−16), byrow=T, ncol=2)
> A
[,1] [,2]
[1,] 17 −6
[2,] 45 −16
>
Then multiply three times
> A%*%A%*%A
[,1] [,2]
[1,] 53 −18
[2,] 135 −46
>
By the way, the power operation
ˆ
does not yield the correct result, as you can check trying
> Aˆ3
[,1] [,2]
[1,] 4913 −216
[2,] 91125 −4096
What this operation does is simply raise ...