imat_ctrace/intersect


Purpose

Return the coordinates common to two imat_ctrace.

Syntax

tf=intersect(ta,tb)
[tf,ia,ib]=intersect(ta,tb)

Description

INTERSECT for the imat_ctrace TA and TB returns an imat_ctrace TF containing the coordinates common to both TA and TB. IA and IB are optional vector outputs such that TF=TA(IA) and TF=TB(IB).

Starting in MATLAB R2013a, the behavior of INTERSECT has changed. To preserve the behavior of previous versions of MATLAB, pass in the string 'legacy'.

Examples

>> ta=imat_ctrace('1x','2y','3x');
>> tb=imat_ctrace('1x','1y','1z','2x','2y','2z','3x','3y');
>> [tf,ia,ib]=intersect(ta,tb)

tf =
     '1X+'
     '2Y+'
     '3X+'

ia =
     1
     2
     3

ib =
     1
     5
     7

>>

See Also

imat_ctrace/ismember, imat_ctrace/setdiff, imat_ctrace/setxor, imat_ctrace/union, imat_ctrace/unique