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

data = ["plane","car","train","car","plane"];
categoriesOfData = ["boat","car","plane","train"];
A = categorical(data,categoriesOfData)

%
% Determine if boat is a category in A.

tf = iscategory(A,"boat")

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