view evaluationtools/compareunorderedsets.m @ 1:8973548174c1 tip

adding tools to repo
author christopherh
date Mon, 06 May 2013 14:43:47 +0100
parents
children
line wrap: on
line source

function [match,success,errormessage] = compareunorderedsets(set1,set2,cardinality)


if nargin<3
    cardinality = 6;
end



errormessage = '';
success = 1;
match = 0;



if strcmp(class(set1),class(set2))


        % make sure that the sets don't contain duplicate objects
        X = unique(set1);
        Y = unique(set2);


        u = length(intersect(X,Y));

        m = min(cardinality,max(length(X),length(Y)));

        if u >= m

            match = 1;

        else

            match = 0;

        end
else
     success = 0;
     errormessage = 'Error in compareunorderedsets: trying to compare mixed data types';
end