tr {lazy.mat}R Documentation

Trace of the input square matrix: Sum of all the diagonal elements of a square matrix.

Description

Trace of the input square matrix: Sum of all the diagonal elements of a square matrix.

Usage

tr(A)

Arguments

A

Input square matrix or scalar

Details

Can be used with a character matrix.

Value

trace of A

Examples

tr(demomat(2,2))

[Package lazy.mat version 0.1.4 Index]