imat_ctrace/in_ctrace


Purpose

Check which imat_fn elements match trace.

Syntax

v=in_ctrace( t, f, 'ref' )
v=in_ctrace( t, f, 'res' )

Description

The IN_CTRACE utility function creates a logical array v which describes which function elements in f have reference or response coordinate labels matching elements of the coordinate trace t. The output array is dimensioned [prod(size(f)) length(t)]. (Thus, even if f is multidimensional it is treated as a column vector.)

If the third argument is 'ref', then the output array v is defined so that v(m,n) is true (1) if the reference coordinate of the m'th element of f is equal to the n'th element of the coordinate trace t. If the third argument is 'res', then the logical values are based on the response coordinates of f.

If the third argument is omitted, 'res' is assumed.

Note that any(in_ctrace(t,f,...)) returns a row vector which could be used to select those elements of f that are in the coordinate trace t.

Examples

>> f=readadf('sample.ati')

f =

3x1 IMAT Function with the following attributes:

Record Name                 FunctionType     AbscissaSpacing  NumberElements
--------------------------- ---------------- ---------------- ----------------
1_(1X+,1X+)                 Time Response    Even             1601
2_(1X+,2X+)                 Time Response    Even             1601
3_(1X+,3X+)                 Time Response    Even             1601

>> t=imat_ctrace('1x','2x','3x','4x')

t =

    '1X+'
    '2X+'
    '3X+'
    '4X+'

>> in_ctrace(t,f,'res')   % Match response coordinates

ans =

      1     0     0     0
      0     1     0     0
      0     0     1     0

>> in_ctrace(t,f,'ref')   % Match reference coordinates

ans =

      1     0     0     0
      1     0     0     0
      1     0     0     0

>>

See Also

imat_fn/allref, imat_fn/allres