Skip to content

ismembc

matlab_compat · scripts/matlab_compat/ismembc.m

ISMEMBC Membership test against a sorted set (MATLAB compat).

TF = ISMEMBC (A, S) returns a logical array the size of A that is true where the corresponding element of A occurs in S.

This is one of MATLAB’s undocumented helpers. It is not in the documentation, but it is a real entry point that shipping code calls – it is the fast path MATLAB’s own ismember () uses – so code written against MATLAB reaches it and fails here with "’ismembc’ undefined".

Real case: MTEX bundles txt2mat (), which uses ismembc () to find the printable characters in a file it is about to parse. Every .ctf and .ang EBSD file therefore failed to load, and the error surfaced far from the cause as "Generic interface could not detect any numeric data".

MATLAB requires S to be sorted ascending with no NaN; that is a precondition for its speed, not a difference in meaning, so this implementation simply answers the same question via ismember ().