Learn R Programming

matlib (version 0.8.1)

row_cofactors: Row Cofactors of A[i,]

Description

Returns the vector of cofactors of row i of the square matrix A. The determinant, det(A), can then be found as M[i,] %*% row_cofactors(M,i) for any row, i.

Usage

row_cofactors(A, i)

Arguments

A

a square matrix

i

row index

Value

a vector of the cofactors of A[i,]

See Also

det for the determinant

Other determinants: cofactor, minor, row_minors

Examples

Run this code
# NOT RUN {
M <- matrix(c(4, -12, -4,
              2,   1,  3,
             -1,  -3,  2), 3, 3, byrow=TRUE)
minor(M, 1, 1)
minor(M, 1, 2)
minor(M, 1, 3)
row_cofactors(M, 1)
det(M)
# expansion by cofactors of row 1
M[1,] %*% row_cofactors(M,1)

# }

Run the code above in your browser using DataLab