norm
Vector and matrix norms
Description
returns the Euclidean norm of
vector n = norm(v)v. This norm is also called the 2-norm, vector
magnitude, or Euclidean length.
returns the generalized vector
p-norm.n = norm(v,p)
returns the p-norm of matrix n = norm(X,p)X, where
p is 1, 2, or
Inf:
If
p = 1, thennis the maximum absolute column sum of the matrix.If
p = 2, thennis approximatelymax(svd(X)). This value is equivalent tonorm(X).If
p = Inf, thennis the maximum absolute row sum of the matrix.
returns the Frobenius norm of
matrix or array n = norm(X,"fro")X.
Examples
Input Arguments
Output Arguments
More About
Tips
Use
vecnormto treat a matrix or array as a collection of vectors and calculate the norm along a specified dimension. For example,vecnormcan calculate the norm of each column in a matrix.