MATLAB: Do I receive incorrect results when using three-dimensional arrays with the ISMEMBER function in MATLAB 6.5 (R13)

3acceldimensionfeatureismemberjitMATLABoffonthird

Why do I receive incorrect results when using three-dimensional arrays with the ISMEMBER function in MATLAB 6.5 (R13)?
I am using ISMEMBER on a three-dimensional array and a false answer is returned. For instance, when I do the following:
ismember(cat(3, 'x', 'y', 'x'), 'xy')
MATLAB returns the following:
ans(:,:,1) =
1
ans(:,:,2) =
0
ans(:,:,3) =
0

Best Answer

This has been verified as a bug in MATLAB 6.5 (R13) in the way that the JIT Accelerator handles the ISMEMBER function.
Currently, to work around this issue, disable the JIT Accelerator prior to any call to ISMEMBER. You can then turn it back on to preserve the MATLAB performance improvements resulting from the JIT accelerator. The following code illustrates this:
feature accel off
ismember(cat(3,'x','y','x'),'xy')
feature accel on