Skip to main content

Extract

Extract [ /FREE /INDX /O ][ typeFlags ] srcWave, destWave, LogicalExpression

The Extract operation finds data in srcWave wherever LogicalExpression evaluates to TRUE and stores any matching data sequentially in destWave, which will be created if it does not already exist.

Parameters

srcWave is the name of a wave.

destWave is the name of a new or existing wave that will contain the result.

LogicalExpression can use any comparison or logical operator in the expression.

Flags

/FREECreates a free destWave (see Free Waves).
/FREE is allowed only in functions and only if a simple name or wave reference structure field is specified for destWave.
/INDXStores the index in destWave instead of data from srcWave.
/OAllows destWave to be the same as srcWave (overwrite source).

Type Flags (functions only)

Extract also can use various type flags in user functions to specify the type of destination wave reference variables. These type flags do not need to be used except when it is necessary to match another wave reference variable of the same name or to tell Igor what kind of expression to compile for a wave assignment. See WAVE Reference Types and WAVE Reference Type Flags for a complete list of type flags and further details.

Details

srcWave may be of any type including text.

destWave has the same type as srcWave, but it is always one dimensional. With /INDX, the destWave type is set to unsigned 32-bit integer and the values represent a linear index into srcWave regardless of its dimensionality.

Example

Make/O source= x
Extract/O source,dest,source>10 && source<20
print dest

Prints the following to the history area:

dest[0]= {11,12,13,14,15,16,17,18,19}

See Also

Duplicate