Emulate ismember in scilab

Sébastien Bihorel sbihorel at gmail.com
Sat Nov 7 13:31:49 CET 2009


Dear Scilab users,

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.

Here is a section of the Matlab help about ismember:
[tf, loc] = ismember(A, S, ...) returns an array loc containing the *highest
*index in S for each element in A that is a member of S.


Here is an example of Scilab code that I tried
a = [5 3 1 7 2 9 2 6 4 1 3 6 8 0 1 4];
b=1:5;
[v,ka,kb]=intersect(a,b,'c');

Surprisingly, ka is a mix of lowest and highst indexes...

Any help would be appreciated.

Sebastien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20091107/416f8f14/attachment.htm>


More information about the users mailing list