1 function [unique_vectors, count] = count_column_frequency(vectors)
2 %
function [unique_vectors, count] = count_columns_frequency(vectors)
4 %
function removing duplicates from the matrix
"vectors" (which
5 % contains columnwise vectors) and determining the frequency of the
6 % vectors. i.e. unique_vectors(:,i) appeared count(i) times in the
9 % The implementation is "expensive" by a
double loop. Could be optimized.
11 % Bernard Haasdonk 26.7.2006
13 % expensive:
double loop!!
15 nvec = size(vectors,2);
20 treated = zeros(1,nvec);
23 unique_vectors = [unique_vectors, vectors(:,i)];
24 % l-infty difference of all other vectors to current one
26 ii = repmat(vectors(:,i),1,nvec-i+1);
27 di = max(abs(vectors(:,i:end)-ii));
30 count = [count, length(j)];
34 % TO BE ADJUSTED TO NEW SYNTAX