view evaluation/countElementOccurences.m @ 37:d9a9a6b93026 tip

Add README
author DaveM
date Sat, 01 Apr 2017 17:03:14 +0100
parents 4af6fc2100e8
children
line wrap: on
line source
function [LU,occ] = countElementOccurences(L)

LU = unique(L);
occ = zeros(length(LU),1);

for i = 1:length(L)
    for ii = 1:length(LU)
        if(strcmp(L{i}, LU{ii}))
%             fprintf('L= %s, LU= %s \n',L{i},LU{ii});
            occ(ii) = occ(ii) + 1;
        end
    end
end

end