Built-in Function: **norm** (`A, p`)

Built-in Function: **norm** (`A, p, opt`)

Compute the p-norm of the matrix

A. If the second argument is missing,`p = 2`

is assumed.If

Ais a matrix (or sparse matrix):

p=`1`

- 1-norm, the largest column sum of the absolute values of
A.p=`2`

- Largest singular value of
A.p=`Inf`

or`"inf"`

- Infinity norm, the largest row sum of the absolute values of
A.p=`"fro"`

- Frobenius norm of
A,`sqrt (sum (diag (`

A`' *`

A`)))`

.- other
p,p`> 1`

- maximum
`norm (A*x, p)`

such that`norm (x, p) == 1`

If

Ais a vector or a scalar:

p=`Inf`

or`"inf"`

`max (abs (`

A`))`

.p=`-Inf`

`min (abs (`

A`))`

.p=`"fro"`

- Frobenius norm of
A,`sqrt (sumsq (abs (A)))`

.p= 0- Hamming norm - the number of nonzero elements.
- other
p,p`> 1`

- p-norm of
A,`(sum (abs (`

A`) .^`

p`)) ^ (1/`

p`)`

.- other
pp`< 1`

- the p-pseudonorm defined as above.
If

optis the value`"rows"`

, treat each row as a vector and compute its norm. The result is returned as a column vector. Similarly, ifoptis`"columns"`

or`"cols"`

then compute the norms of each column and return a row vector.

See also:cond, svd.

Package: octave