%% Find Values in Categorical Array
% Create a categorical array with two values: 'heads' and 'tails'.

A = categorical({'heads' 'heads' 'tails'; 'tails' 'heads' 'tails'})

%
% Find all values in the 'heads' category.

A == 'heads'

% A value of logical 1 (true) indicates a value in the category.
%
% Compare the rows of A for equality.

A(1,:) == A(2,:)

% A value of logical 1 (true) indicates where the rows have equal category values.
% Copyright 2015 The MathWorks, Inc.