from DataStructures by Paul Richards
Set and map datastructures implemented in pure Matlab

DefaultComparator(left, right)
function val = DefaultComparator(left, right)
    % Default "comparator" function based on < and ==.
    % Returns -ve, zero, or +ve if left is less than, equal to, or greater
    % than right.
    if left < right
        val = int32(-1);
    elseif left == right
        val = int32(0);
    else
        val = int32(1);
    end
end

Contact us at files@mathworks.com