norm¶
norm calculates various matrix norms.
- rsNorm = norm(m)
- rsNorm = norm(m, ssType)
Return Value
rsNorm is the matrix norm.
Parameters
- m
is a real or complex matrix.
- ssType
is an option string that sets the matrix norm. It can have one of the following values:
Value
Meaning
"1"
1-Norm (maximum column sum).
"2"
2-Norm (maximum singular value).
"I"
oder “Inf”Infinit Norm (maximum row sum).
"F"
oder “Frob”Frobenius-Norm (Square root of the sum of the aquare of the matrix elements).
"M"
oder “Max”Maximum-Norm (maximum of the absolute value).
Comment
ssType is not case sensitive.
Example
* a = [1,2,3;4,5,6;7,8,9]
* a
1.0000 2.0000 3.0000
4.0000 5.0000 6.0000
7.0000 8.0000 9.0000
* // Calculate various
* // Matrix Norms:
* norm(a)
18.0000
* norm(a, "1") // 1-Norm
18.0000
* max(sum(abs(a)))
18.0000
* norm(a, "2") // 2-Norm
16.8481
* norm(a, "Inf") // Infinit-Norm
24.0000
* max(sum(abs(a')))
24.0000
* norm(a, "Frob") // Frobenius-Norm
16.8819
* sqrt(sum(sum(a.*a)))
16.8819
* norm(a, "m") // Maximum-Norm
9.0000
* max(max(abs(a)))
9.0000
See also
id-796612