how to count unique elements of a cell in matlab? the a above code will count the number of characters in a cell I liked this
[uniqueC,~,idx] = unique(characterCell); %# uniqueC are unique entries in c
%# replace the tilde with 'dummy' if pre-R2008a
counts = accumarray(idx(:),1,[],@sum);
but the broblem is: my cell contains alphabet letters from a to e. I want to find no of 'a's 'b's...... this code will not tell that there is e.g. zero 'e's if it is not available. simply there will be 4 counts instead of 5
1 2 2 3
and not
1 2 2 3 0
How can I add
a=1 b=2......