findin
findin(a, b)
Returns the indices of elements in collection a
that appear in collection b
Examples
julia> findin([1,2,2],[2,4,5])
2-element Array{Int64,1}:
2
3
julia> findin([1,2,3],[2,4,5])
1-element Array{Int64,1}:
2
julia> foo = [2, 5, 7, 5, 2, -1];
julia> bar = [2, 5, 4];
julia> findin(bar, foo)
1
2
See Also
find, findfirst, findin, findlast, findmin, findn, findnext, findnz, findprev, rsearch, rsearchindex, searchsorted, searchsortedfirst, searchsortedlast, sort, sort!, sortcols, sortperm, sortperm!,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.