I have an enumeration defined somewhere:
classdef MyError
enumeration
Error0
Error1
Error2
end
end
Then, I'm trying a simple call to ismember with different version of Matlab.
R2012a:
>> enums = enumeration('MyError');
>> ismember(MyError.Error0,enums)
ans =
1
R2013b:
>> enums = enumeration('MyError');
>> ismember(MyError.Error0,enums)
Undefined function 'sort' for input arguments of type 'MyError'.
Error in ismember>ismemberClassTypes (line 711)
sort(ab(1));
Error in ismember>ismemberR2012a (line 490)
lia = ismemberClassTypes(a,b);
Error in ismember (line 57)
[varargout{1:max(1,nargout)}] = ismemberR2012a(A,B);
I'm looking at the code issuing the error and I cannot understand what is the purpose of the call to 'sort' because its input is a scalar value and the output is not stored. Given that calling ismember on enumerated value is rather common task, I'm surprised to see such regressions.
Any ideas for a work-around?