Skip to content

norm

Vector or matrix norm.

n = norm(A)
n = norm(A, p)
n = norm(A, 'fro')

Returns the norm of A. The interpretation depends on A’s shape and the p argument:

  • For vectors: p = 2 (default) is the Euclidean norm, p = 1 the sum of absolute values, p = Inf the max absolute value, any positive scalar p the p-norm.
  • For matrices: p = 2 (default) is the largest singular value, p = 1 the max column sum, p = Inf the max row sum, 'fro' the Frobenius norm (sqrt of sum of squared entries).
norm([3 4]) % 5 (Euclidean)
norm([3 4], 1) % 7 (sum of |x|)
norm(magic(3)) % 15 (largest singular value)
norm(magic(3), 'fro') % ~16.882
  • cond — Condition number of a matrix.
  • svd — Singular value decomposition.