imat_fn/envelope


Purpose

Create an envelope function of the supplied imat_fn.

Syntax

g=envelope(f)
g=envelope(f,'min')
g=envelope(F,TYPE,INTTYPE,EXTRAP)
g=envelope(f,'mean','spline',false)

Description

ENVELOPE will create an envelope of the supplied imat_fn. F is the supplied input imat_fn. TYPE is an optional string specifying the type of envelope. Complex data is converted to amplitude before taking the envelope. Passing in an empty string ('') for TYPE tells ENVELOPE to use the default. Valid TYPEs are

TYPE

Description

'min'

Envelope the minima

'max'

Envelope the maximum values [default]

'mean'

Envelope the mean values

INTTYPE is a string containing the interpolation type. Valid types are any supported by the MATLAB function INTERP1. The default is 'linear'. Interpolation (and extrapolation) only comes into play if not all of the supplied functions have the same abscissa values.

EXTRAP is a logical specifying whether to allow extrapolation if the function is interpolated. The default is TRUE. However, note that the extrapolation can be dangerous since it generates data values that don't exist in the data. If you get strange results, try turning off extrapolation.

ENVELOPE takes into consideration the abscissa values for each of the functions. At a given abscissa data point, envelope will only consider functions that have data at point. ENVELOPE will create one function per abscissa data type.

G is an imat_fn containing the output. There will be one function per data type in the input. Each output function takes on the attributes of the first function in F with that abscissa data type.

Examples

>> f=imat_fn(2);
>> f(1).ordinate=5:-1:1;
>> f(2).ordinate=1:5;
>> g=envelope(f,'max','linear');
>> [f.ordinate g.ordinate]

ans =

    5     1     5
    4     2     4
    3     3     3
    2     4     4
    1     5     5

>>