%% 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 not in the 'heads' category.

A ~= 'heads'

% A value of logical 1 (true) indicates a value not in the category. Since A only has two categories, A ~= 'heads' returns the same answer as A == 'tails'.
%
% Compare the rows of A for inequality.

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

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