%% Test for Category with No Corresponding Data
% Create a categorical array, A.

A = categorical({'plane' 'car' 'train' 'car' 'plane'},...
    {'boat' 'car' 'plane' 'train'})

% A is a 1-by-5 categorical array.
%
% Test to see if boat is a category in A.

tf = iscategory(A,'boat')

% iscategory returns true, even though A does not contain any values from the category boat.
% Copyright 2012 The MathWorks, Inc.