A little note on Matlab norm usage

Source: Internet
Author: User

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

    • n  =  norm (A) n  =  norm (a,p)

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 .

    • x = [0 1 2 3]x =      0     1     2     3sqrt (0+1+4+9)   % Euclidean Lengthans =    3.7417norm (x) ans =    3.7417n = Length (x)   % number of ELEMENTSN =     4rms = 3.7417/2  % RMS = norm (x)/sqrt (n) RMS =    1.8708

A little note on Matlab norm usage

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.