imat_ctrace/setdiff


Purpose

Return a set difference of two imat_ctrace with no repetitions.

Syntax

tf=setdiff(ta,tb)
[tf,ia]=setdiff(ta,tb)

Description

SETDIFF for the imat_ctraces TA and TB returns an imat_ctrace TF containing the coordinates in TA that are not in TB. IA is an optional vector output such that TF=TA(IA).

Starting in MATLAB R2013a, the behavior of SETDIFF 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');
>> setdiff(ta,tb)

ans =

empty IMAT coordinate trace

>> [t,ind]=setdiff(tb,ta)

t =

'1Y+'
'1Z+'
'2X+'
'2Z+'
'3Y+'

ind =

2
3
4
6
8

>>

See Also

imat_ctrace/intersect, imat_ctrace/ismember, imat_ctrace/setxor, imat_ctrace/union, imat_ctrace/unique