A little note on Matlab norm usage
Matlab norm (a) usage and examples
Norm (A,p)
When a is a vector
Norm (a,p) Returns sum (ABS (A). ^p) ^ (1/p), for any 1 <= p <=∞.
Norm (A) Returns norm (a,2)
Norm (A,inf) Returns Max (ABS (A)).
Norm (A,-inf) Returns min (abs (A)).
When A is a matrix
n = Norm (a) returns the largest singular value of A, Max (SVD (a))
n = Norm (a,1) the 1-norm, or largest column sum of A, Max (SUM (ABS (A)).
n = Norm (a,2) the largest singular value (same as Norm (A)).
n = Norm (a,inf) The Infinity norm, or largest row sum of A, Max (SUM (ABS (A)))
n = Norm (A, ' fro ') the frobenius-norm of Matrix A, sqrt (SUM (diag (a ' *a))).
Norm
Vector and matrix norms
Syntax
Description
The norm of a matrix is a scalar that gives some measure of the magnitude of the Matrix. The norm
function calculates several different types of matrix norms:
n = norm(A)
Returns the largest singular value A
of max(svd(A))
.
n = norm(A,p)
Returns a different kind of norm, depending on the value ofp.
IF&NBSP P is ... |
then norm returns ... |
1 |
the 1-norm, or largest column sum of A , ; max (SUM (ABS (A)) . |
2 |
the largest singular value (same as norm (A) ) . |
inf |
the Infinity norm, or largest row sum of A , max (SUM (ABS (A))) . |
' fro ' |
the frobenius-norm of matrix A , sqrt (SUM (diag (a ' * a)) . |
When is A
a vector:
norm(A,p) |
Returns sum(abs(A).^p)^(1/p) , for any 1 <= p <= . |
norm(A) |
Returns norm(A,2) . |
norm(A,inf) |
Returns max(abs(A)) . |
norm(A,-inf) |
Returns min(abs(A)) . |
Remarks
Note that is the norm(x)
Euclidean length of a vector x
. On the other hand, MATLAB uses "length" to denote the number of elements in n
a vector. This example uses to norm(x)/sqrt(n)
obtain the Root-mean-square (RMS) is the value of an n
-element vector x
.
A little note on Matlab norm usage