Julia Equivalent for ismember in MATLAB for rows

Note that logical indexing creates a temporary array (the vector saving the indices), potentially leading to slower than necessary code if they are created in a hot loop.

From the docs:

In MATLAB, an idiomatic way to remove unwanted values is to use logical indexing, like in the expression x(x>3) or in the statement x(x>3) = [] to modify x in-place. In contrast, Julia provides the higher order functions filter and filter! , allowing users to write filter(z->z>3, x) and filter!(z->z>3, x) as alternatives to the corresponding transliterations x[x.>3] and x = x[x.>3] . Using filter! reduces the use of temporary arrays.

Since you seem to be iterating over the rows of the matrix, maybe you can tell us more about what you want to do with those logical indices?

Also, you can get the unique rows of your matrix by a simple call to unique:

julia> A = vcat((a,b,a,a,a,a,b,b,b)...)
9×3 Array{Int64,2}:                    
 1  2  3                               
 3  4  5                               
 1  2  3                               
 1  2  3                               
 1  2  3                               
 1  2  3                               
 3  4  5                               
 3  4  5                               
 3  4  5                                                                      

julia> unique(A, dims=1)               
2×3 Array{Int64,2}:                    
 1  2  3                               
 3  4  5
1 Like