vnorm: Vector Norm

Description Usage Arguments Value See Also Examples

Description

Computes the (euclidean) norm of a vector

Usage

1
  vnorm(x)

Arguments

x

a numeric vector (or a one-dimension matrix)

Value

norm of x

See Also

mnorm, normalize

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# vector
v = rep(1, 5)

# norm of v
vnorm(v)

# one-dim (one row) matrix
row1 = matrix(1:5, 1, 5)

# norm of row1
vnorm(row1)

# one-dim (one column) matrix
col1 = matrix(1:5, 5, 1)

# norm of col1
vnorm(col1)

gastonstat/matrixkit documentation built on May 16, 2019, 5:45 p.m.