Norm

Parent Previous Next

Norm


Matrix norm



Syntax


norm(v)

v is a vectir

Return the length of v (sum(abs(vi)^2)^(1/2))

norm(v, p)

v is a vector, p is a real number and p>=1

Return a scalar of value (sum(abs(vi)^p)^(1/p)).

norm(v, mode)

v is a vector, mode is a string of 'inf' or '-inf'

norm(v, 'inf') return value max(abs(vi)). norm(v, '-inf') return value  min(abs(vi))

norm(x)

x is a matrix

return the largest singular value of x

norm(x, n)

x is a matrix, n is a integer and n = 1 or 2

norm(x, 1) returns 1-norm, largest column sum (same with ‘1’), norm(x, 2) returns largest singular value (same with ‘2’)

norm(x, mode)

x is a matrix, mode is a string of '1', '2', 'inf', or 'fro'

norm(x, '1') returns 1-norm, largest column sum (same with 1). norm(x, '2') returns largest singular value (same with 2). norm(x, 'inf') returns infinity norm, the largest row sum. norm(x,'fro') returns Frobenius norm, sqrt(sum(diag(x’*x)))


Examples


Input

Output

norm([2+i, -3i, -4, 1+i])

norm([2+i, -3i, -4, 1+i], 1.2)

norm([2+i, -3i, -4, 1+i], 'inf')

norm([2+i, -3i, -4, 1+i], '-inf')

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i])

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i], 1)

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i], 2)

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i], '1')

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i], '2')

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i], 'inf')

norm([2+i, -3i, -4; 1+i, -1+i, 4+2i; 3+2i, -2+2i, 3-i], 'fro')

Created with the Personal Edition of HelpNDoc: Easily create CHM Help documents