Dear Scilab users,<br><br>Is there an easy method to emulate the Matlab
ismember function to match numerical vectors to one another? I've
tried several things with intersect but it does not seem to give
consistent results.<br>
<br>Here is a section of the Matlab help about ismember:<br>[tf, loc] = ismember(A, S, ...) returns an array loc containing the <b>highest </b>index in S for each element in A that is a member of S.<br><br><br>Here is an example of Scilab code that I tried<br>
a = [5 3 1 7 2 9 2 6 4 1 3 6 8 0 1 4];<br>b=1:5;<br>[v,ka,kb]=intersect(a,b,'c');<br><br>Surprisingly, ka is a mix of low, middle or high indexes... There must a logic behind that, but I do not see the pattern.<br>
<br>I am looking to extract only the highest indexes. Any help would be appreciated. <br><br>Sebastien