Signal Processing Toolkit User Guide > Reference (G to P) > NORM Function (PV-WAVE Extreme Advantage)
  

NORM Function (PV-WAVE Extreme Advantage)
Computes various norms of an array, or the difference of two arrays.
Usage
result = NORM(x [, y])
Input Parameters
x—An array for which the norm is to be computed.
y—(optional) If present, NORM computes the norm of (xy).
Returned Value
result—The requested norm of the input array. If the norm cannot be computed, NaN is returned.
Keywords
Index_Max—A named variable into which the index of the element of x with the maximum modulus is stored. If Index_Max  is used, the keyword Inf  must also be used. If the parameter y is specified, the index of (xy) with the maximum modulus is stored.
Inf—If present and nonzero, computes the infinity norm max|xi|.
One—If present and nonzero, computes the 1-norm:
Discussion
By default, NORM computes the Euclidean norm as follows:
If the keyword One is set, the 1-norm:
is returned. If the keyword Inf  is set, the infinity norm:
max|xi|
is returned. In the case of the infinity norm, the index of the element with maximum modulus also is returned. If the parameter y is specified, the computations of the norms described above are performed on (x y).
Example 1
In this example, the Euclidean norm of an input array is computed.
x = [1.0, 3.0, -2.0, 4.0]
n = NORM(x)
PM, n, Title = 'Euclidean norm of x:' 
Example 2
This example computes max | xiyi | and prints the norm and index.
x = [1.0, 3.0, -2.0, 4.0]
y = [4.0, 2.0, -1.0, -5.0]
n = NORM(x, y, /Inf, Index_Max = imax)
PM, n, Title = 'Infinity norm of (x-y):'
PM, imax, Title = 'Element of (x-y) with maximum modulus:'

Version 2017.0
Copyright © 2017, Rogue Wave Software, Inc. All Rights Reserved.