Learn R Programming

tensr (version 1.0.1)

fnorm: Frobenius norm of an array.

Description

Calculates the Frobenius norm of an array.

Usage

fnorm(X)

Arguments

X

An array, a matrix, or a vector.

Value

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

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.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab