Exercise- Representations- C10
#defining the matrix B and v:
B <- matrix(c(2, -2, 2, 1, 3, 1, 3, 5, 2), 3, 3)
B
## [,1] [,2] [,3]
## [1,] 2 1 3
## [2,] -2 3 5
## [3,] 2 1 2
v <- matrix(c(11, 5, 8), 3, 1)
v
## [,1]
## [1,] 11
## [2,] 5
## [3,] 8
# With augmented matrix we have as below:
A <- matrix(c(2, -2, 2, 1, 3, 1, 3, 5, 2, 11, 5, 8), 3, 4)
A
## [,1] [,2] [,3] [,4]
## [1,] 2 1 3 11
## [2,] -2 3 5 5
## [3,] 2 1 2 8
Arref <- pracma::rref(A)
Arref
## [,1] [,2] [,3] [,4]
## [1,] 1 0 0 2
## [2,] 0 1 0 -2
## [3,] 0 0 1 3
pB.v <- matrix(Arref[,4 ], 3, 1)
pB.v
## [,1]
## [1,] 2
## [2,] -2
## [3,] 3