Learn R Programming

comphy (version 1.0.5)

condet: Determinant of a square matrix

Description

Calculates the determinant of a square matrix of size \(n\), using the reduction of the matrix in upper triangular form.

Usage

condet(A)

Value

A real number corresponding to the determinant of A.

Arguments

A

An \(n\times n\) square matrix of.

Examples

Run this code
# Identity matrix of size 10
A <- diag(10)
print(condet(A))

# Random matrix with integer elements
A <- matrix(sample(-5:5,size=25,replace=TRUE),ncol=5)
print(condet(A))

Run the code above in your browser using DataLab