%% Empty Arrays and Missing Values
% Compare empty arrays to arrays containing missing values.
% In MATLAB®, an empty array has at least one dimension length equal to zero. An array containing missing values, such as NaN or <undefined>, is not necessarily empty.
% Create a categorical vector with missing values.

cat1 = categorical([missing missing])

% Since cat1 does not have a dimension of length zero, it is not empty.

TF1 = isempty(cat1)

% Create a 0-by-0 categorical array and test if it is empty.

cat2 = categorical([]);
TF2 = isempty(cat2)

% Copyright 2018 The MathWorks, Inc.