norm
Vector and matrix norms
Syntax
n = norm(v)
n = norm(v,p)
n =规范(X)
n = norm(X,p)
n = norm(X,'fro')
Description
returns theEuclidean normof vectorn
= norm(v
)v
. This norm is also called the 2-norm, vector magnitude, or Euclidean length.
returns thegeneralized vector p-norm.n
= norm(v
,p
)
returns thep-norm of matrixn
= norm(X
,p
)X
, wherep
is1
,2
, orInf
:
If
p = 1
, thenn
is themaximum absolute column sumof the matrix.If
p = 2
, thenn
is approximatelymax(svd(X))
. This is equivalent tonorm(X)
.If
p = Inf
, thenn
is themaximum absolute row sumof the matrix.
returns theFrobenius normof matrixn
= norm(X
,'fro')X
.
Examples
Input Arguments
Output Arguments
More About
Tips
Use
vecnorm
to treat a matrix or array as a collection of vectors and calculate the norm along a specified dimension. For example,vecnorm
can calculate the norm of each column in a matrix.
Extended Capabilities
Introduced before R2006a
Was this topic helpful?