anyEq (Scripts) Publisher's description
from Jan Simon
This is a simple but fast check, if two arrays contain any common element
This is a simple but fast check, if two arrays contain any common element.
If no common element is found, the C-Mex is 30% to 50% faster than the equivalent Matlab expression "any(X(:) == y)" and much faster than "any(ismember(X, Y))" if Y is an array.
If a matching element is found early, this function returns very fast without testing the rest.
In opposite to the Matlab version, the C-mex does not need any temporary arrays.
R = anyEq(X, Y)
X, Y: Arrays, arbitrary size. The order of X and Y does not influence
the speed. Types: DOUBLE, SINGLE, (U)INT8/16/32/64, CHAR.
R: TRUE if X and Y have any common element.
Tested: Matlab 6.5, 2008a/b, 2009a, 2011b, 32/64 bit
LCC, BCC, OWC, MSVC 2008 and 2010, WinXP and Win7.
Assumed compatibility: Linux, MacOS.
Pre-compiled Mex: http://www.n-simon.de/mex
Suggestion and bugreports through the author page of the FEX or by email are appreciated.
System Requirements:MATLAB 7.8 (R2009a)
Program Release Status: New Release
Program Install Support: Install and Uninstall