Compute the p-norm of the matrix A.
If the second argument is not given, p = 2
is used.
If A is a matrix (or sparse matrix):
1
1-norm, the largest column sum of the absolute values of A.
2
Largest singular value of A.
Inf
or "inf"
Infinity norm, the largest row sum of the absolute values of A.
"fro"
Frobenius norm of A, sqrt (sum (diag (A' * A)))
.
p > 1
maximum norm (A*x, p)
such that norm (x, p) == 1
If A is a vector or a scalar:
Inf
or "inf"
max (abs (A))
.
-Inf
min (abs (A))
.
"fro"
Frobenius norm of A, sqrt (sumsq (abs (A)))
.
Hamming norm—the number of nonzero elements.
p > 1
p-norm of A, (sum (abs (A) .^ p)) ^ (1/p)
.
p < 1
the p-pseudonorm defined as above.
If opt is the value "rows"
, treat each row as a vector and
compute its norm. The result is returned as a column vector.
Similarly, if opt is "columns"
or "cols"
then
compute the norms of each column and return a row vector.
See also: normest, normest1, cond, svd.
Package: octave