%% Plot Categorical Histogram
% 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'})

%
% Plot a categorical histogram of the votes, using a relative bar width of 0.5.

h = histogram(C,'BarWidth',0.5)

% Copyright 2015 The MathWorks, Inc.