christopherh@1: christopherh@1: christopherh@1: function [match,success,errormessage] = compareorderedsets(set1,set2,cardinality) christopherh@1: christopherh@1: errormessage = ''; christopherh@1: success = 1; christopherh@1: match = 0; christopherh@1: christopherh@1: if nargin<3 christopherh@1: cardinality = 6; christopherh@1: end christopherh@1: christopherh@1: christopherh@1: christopherh@1: christopherh@1: % check to see if sets are same type christopherh@1: if strcmp(class(set1),class(set2)) christopherh@1: % check whether dealing with strings, cell arrays of chars or arrays of ints christopherh@1: if ischar(set1) christopherh@1: christopherh@1: % compare strings christopherh@1: if strcmp(set1,set2) christopherh@1: match = 1; christopherh@1: else christopherh@1: match = 0; christopherh@1: end christopherh@1: end christopherh@1: christopherh@1: if iscell(set1) christopherh@1: % compare cell arrays of characters christopherh@1: christopherh@1: % fill blank spaces so that cardinalities match christopherh@1: while length(set1)