MATLAB: Does SETXOR behaves differently in MATLAB 7.6 (R2008a) as compared to MATLAB 7.5 (R2007b)

MATLAB

I have two cell arrays of strings (say X and Y). If one of the cell array is empty, the command SETXOR(X,Y) used to return unsorted cell array in MATLAB 7.5(R2007b). This behavior has changed in MATLAB 7.6 (R2008a). i.e. now the command SETXOR(X,Y) return sorted cell array for all the conditions.

Best Answer

This is the intended behavior of SETXOR command. The documentation says that this command will return sorted result. However, this command used to return unsorted result if one of the input is empty (See Geck #383992). This unintended behavior was modified in MATLAB 7.6 (R2008a)
To workaround this issue, please execute the following steps:-
1. Download the attached file ('setxor_old.m').
2. Store this file in the following folder: '$matlabroot\toolbox\matlab\ops\@cell\'. Please note that '$matlabroot' is your MATLAB installation directory.
3. Execute REHASHTOOLBOX command at the MATLAB command prompt.
Now you can use the command SETXOR_OLD in MATLAB 7.6(R2008a) to obtain the behavior as that of SETXOR in MATLAB 7.5(R2007b)