fnorm: Frobenius norm of an array.

Description Usage Arguments Details Value Author(s) Examples

Description

Calculates the Frobenius norm of an array.

Usage

1
fnorm(X)

Arguments

X

An array, a matrix, or a vector.

Details

The Frobenius norm of an array is the square root of the sum of its squared elements. This function works for vector and matrix arguments as well.

Value

The square root of the sum of the squared elements of X.

Author(s)

David Gerard.

Examples

1
2
3
4
5
6
X <- c(1:8)
Y <- matrix(1:8, nrow = 2)
Z <- array(1:8, dim = c(2, 2, 2))
fnorm(X)
fnorm(Y)
fnorm(Z)

Example output

[1] 14.28286
[1] 14.28286
[1] 14.28286

tensr documentation built on May 2, 2019, 2:32 p.m.