`tt_sample_zeros` uses builtin function `_ismemberhelper` explicitly
tt_sample_zeros
uses the builtin function _ismemberhelper
explicitly:
Line 87:
iszero = ~builtin('_ismemberhelper',tmpidx,Xnzidx);
However, in a recent update (somewhere between R2018a and R2021a, the versions I have access to and tested), the behavior of the builtin function has changed.
This works in R2018a but not in R2021a:
iszero = ~builtin('_ismemberhelper',tmpidx,Xnzidx);
This works in R2021a but not in R2018a:
iszero = ~matlab.internal.math.ismemberhelper(tmpidx,Xnzidx);
I suggest that we simply use the following, avoiding the use of builtin/internal functions.
This works in both R2021a and R2018a:
iszero = ~ismember(tmpidx,Xnzidx);
Moreover, in those two versions, it uses the builtin/internal functions that are available in each version, leading to good performance and portability across Matlab versions.