Products & Services Industries Academia Support User Community Company

Learn more about Statistics Toolbox   

ismember - Class: categorical

True for elements of categorical array in set

Syntax

TF = ismember(A,levels)
[TF,LOC] = ismember(A,levels)

Description

TF = ismember(A,levels) returns a logical array the same size as the categorical array A, containing true (1) where the level of the corresponding element of A is equal to one of the levels specified in levels, and false (0) otherwise. levels is a categorical array, or a cell array of strings or 2-D character array containing level labels.

[TF,LOC] = ismember(A,levels) also returns an index array LOC containing the highest absolute index in levels for each element in A whose level is a member of levels, and 0 if there is no such index.

See Also

intersect, islevel, setdiff, setxor, union, unique

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS