%% Categorical Bin Counts
% Create a categorical vector that represents votes. The categories in the vector are 'yes', 'no', or 'undecided'.

A = [0 0 1 1 1 0 0 0 0 NaN NaN 1 0 0 0 1 0 1 0 1 0 0 0 1 1 1 1];
C = categorical(A,[1 0 NaN],{'yes','no','undecided'})

%
% Determine the number of elements that fall into each category.

[N,Categories] = histcounts(C)

% Copyright 2015 The MathWorks, Inc.