Note: This page has been translated by MathWorks. Click here to see

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Vector-wise norm

`N = vecnorm(A)`

`N = vecnorm(A,p)`

`N = vecnorm(A,p,dim)`

`N = vecnorm(`

returns the 2-norm or
Euclidean
norm of `A`

)`A`

:

If

`A`

is a vector, then`vecnorm`

returns the norm of the vector.If

`A`

is a matrix, then`vecnorm`

returns the norm of each column.If

`A`

is a multidimensional array, then`vecnorm`

returns the norm along the first array dimension whose size does not equal 1.

`N = vecnorm(`

calculates the generalized
vector p-norm.`A`

,`p`

)