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

1 view (last 30 days)
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

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
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

More Answers (0)

Categories

Find more on Structures in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!