The
SMOOTH
function returns a copy of *
Array*
smoothed with a
boxcar average of the specified width. The result has the same type and dimensions as *
Array*
. The algorithm used by SMOOTH is:

where *
N*
is the number of elements in A.

The width of the smoothing window, in each dimension. *
Width*
should be an odd number, smaller than the smallest dimension of *
Array*
. If *
Width*
is an even number, one plus the given value of *
Width*
is used. For example, if you use a *
Width*
of 3 to smooth a two-dimensional array, the smoothing window will contain nine elements (including the element being smoothed). The value of *
Width*
does not affect the running time of SMOOTH to a great extent.

Set this keyword to apply the smoothing function to all points. If the neighborhood around a point includes a point outside the array, the nearest edge point is used to compute the smoothed result. If EDGE_TRUNCATE is not set, the end points are copied from the original array to the result with no smoothing.

For example, when smoothing an *
n*
-element vector with a three point wide smoothing window, the first point of the result R_{
0}
is equal to A_{
0}
if EDGE_TRUNCATE is not set, but is equal to (A_{
0}
+A_{
0}
+A_{
1}
)/3 if the keyword is set. In the same manner, point R_{
n-1}
is set to A_{
n-1}
if EDGE_TRUNCATE is not set, or to (A_{
n-2}
+A_{
n-1}
+A_{
n-1}
)/3 if it is.

Points not within a distance of *
Width*
/2 from an edge are not affected by this keyword.

Set this keyword to cause the routine to check for occurrences of the IEEE floating-point value NaN in the input data. Elements with the value NaN are treated as missing data. (See Special Floating-Point Values for more information on IEEE floating-point values.)