c = [ "3-"
"0"
"0+"
"0-"
"0+"
"0"
"0-"
"0-"
"0-"
"0-"
"3"
"0-"
"U"
"3"
"U"
"U"
"2+"
"0"
"1-"
"2-"
"3-"
"1-"
"2"
"2"
"1-"
"1-"
"1-"
"1-"
"1-"
"1-"
"3"
"3-"
"3"
"3"
"3"
"3"
"3"
"3"
"3"
"3-"
"3"
"U"
"U"
"U"
"3"
"3"
"3"
"3"
"U"
"3"
"3"
"3"
"3"
"3"
"3"
"3"
"3"
"3"
"3"
"3"
"0+"
"3"
"3"
"3"
"2"
"0"
"0"
"0+"
"3-"
"3+"
"0+"
"0+"
"0+"
"2+"
"2+"
"2+"
"0+"
"0+"
"0+"
"0+"
"0+"
"0+"
"0+"
"0+"
"2+"
"0+"
"0+"
"0+"
"0+"
"0"
"0+"
"2+"
"0+"
"0+"
"0+"
"2+"
"0+"
"0+"
"0-"];
B = categorical(c);
% Method 1: Was unable to get annotations.
figure(11)
histogram(B);
grid on; grid minor;
[N,Categories] =histcounts(B);
for ii = 1:numel(N)
fprintf( "%-3s : %3d \n", Categories{ii}, N(ii) );
end
% Method 2: Using bar, able to get more annotations
Bunq = unique(B);
figure(12), hb = bar( Bunq, N );
xtips1 = hb.XEndPoints;
ytips1 = hb.YEndPoints;
labels1 = string(hb.YData);
text(xtips1,ytips1,labels1,'HorizontalAlignment','center', 'VerticalAlignment','bottom')
grid on; grid minor;