tr: Matrix Trace

View source: R/linalg.R

trR Documentation

Matrix Trace

Description

The trace of a square matrix is the sum of the diagonal elements.

Usage

tr(x, ...)

## Default S3 method:
tr(x, ...)

Arguments

x

If yac_symbol treat as such, else call tr.default().

...

further arguments passed to tr.default()

Examples

(x <- matrix(1:4, ncol = 2))
tr(x)
tr(ysym(x))

Ryacas documentation built on Jan. 17, 2023, 1:11 a.m.