MATLAB: How to find same elements in a cell array

cell arrayfind

Hello all,
I have the following question:
I need to find the same elements and how many times they are repeated in a cell array. The elements are vectors of integers (e.g, [1,3,4,5]). Then, I'd like to find the repeated sequences and the count of their repetitions.
For example, suppose that the cell array (C) is composed as follows:
[1,2,4,5] [1,4,2,5] [1,2,4,5] [4,1,5,2] [1,2,4,5] [1,4,2,5]
Is there any smart solution to get the sequences [1,2,4,5] and [1,4,2,5], and their repetitions (3 and 2, respectively)?
Thanks in advance,
Ale

Best Answer

a={[1,2,4,5] [1,4,2,5] [1,2,4,5] [4,1,5,2] [1,2,4,5] [1,4,2,5]}
b=cell2mat(a')
[ii,jj,kk]=unique(b,'rows')
out=[ii accumarray(kk,1)]
The last column of out is the frequency