# Knowledge Base

 Navigation: Scripting Language > Functions norm We've made some changes. Use 'Ctrl-F5' to clear your browser cache.

Returns the natural norm of a matrix induced by the L2-norm (spectral norm). For a matrix A this is the square root of the maximum eigenvalue of the matrix product AHA, where AH is the conjugate transpose of A.

Note that for a N-dimensional complex vector x = [x1,x2,...,xN] this reduces to the usual norm:

 Supported Product: FDTD, MODE, DEVICE, INTERCONNECT

 Syntax Description out = norm(y); Returns the spectral norm of the matrix y.

Example

Find the usual norm of real and complex vectors.

y1=[1,2,3];

y2=[1+1i,2,3]; #y2 has complex elements

?norm(y1);

?norm(y2);

result:

3.74166

result:

3.87298

# Confirm the results with the usual definition:

?sqrt(sum(conj(y1)*y1));

?sqrt(sum(conj(y2)*y2));

result:

3.74166

result:

3.87298+0i

Find the usual norm of a complex matrix.

A=[1,2+7i,3;7+3i,0,9];

?norm(A);

?sqrt(max(eig(mult(ctranspose(A),A)))); # confirm the result using the definition

result:

12.332

result:

12.332