Learn R Programming

ADtools (version 0.5.4)

tr: Trace of a matrix

Description

Trace of a matrix

Usage

tr(x)

Arguments

x

A square numeric matrix

Examples

Run this code
# NOT RUN {
A <- randn(2, 2)
tr(A)

B <- randn(3, 3)
tr(B)

# }

Run the code above in your browser using DataLab