1 function [isThereVec,indThereVec]=
ismemberbyfunc(leftVec,rightVec,fCompare)
8 isThereVec=
false(size(leftVec));
9 indThereVec=zeros(size(leftVec));
12 throwerror(
'wrongInput',
'leftVec is expected to be a vector');
14 if ~isvector(rightVec)
15 throwerror(
'wrongInput',
'rightVec is expected to be a vector');
17 isCell=iscell(leftVec);
18 if iscell(rightVec)~=isCell
20 [
'leftVec and rightVec must be either cells or non cells ',...
35 leftVecMat=
repmat(leftVec,length(rightVec),1);
36 rightVecMat=
repmat(rightVec,1,length(leftVec));
38 isEqualMat=cellfun(fCompare,leftVecMat,rightVecMat);
40 isEqualMat=arrayfun(fCompare,leftVecMat,rightVecMat);
43 isThereVec=any(isEqualMat,1);
45 [indBMat,indAMat]=find(isEqualMat);
48 indThereVec=accumarray(indAVec,indBVec,[numel(leftVec) 1],@min,0);
51 isThereVec=isThereVec.
'; 53 indThereVec=indThereVec.';
function throwerror(in msgTag, in varargin)
THROWERROR works similarly to built-in ERROR function in case when there is no output arguments but s...
function repmat(in inpArray, in varargin)
function ismemberbyfunc(in leftVec, in rightVec, in fCompare)
ISMEMBERBYFUNC - ismember implementation for arrays of any type where an element comparison is perfor...