Hi!
I want to check if an integer is contained by a vector of StaticArrays. Here’s an example (with regular arrays, but it’s the same issue).
a = [[1,2], [3,4]]
1 in a # false
I guess I could write a for loop, but that’s not very elegant.
Notes:
- The number I’m looking for will always be in the first “column” (i.e., first position of a subarray).
- If the number is in
a
, I will need to find it’s position, something like this:findfirst(x->x==1,a)
, which doesn’t work in this case either.
Thanks a lot!
PS: this is a silly question, but a difficult one to Google. The word “in” is a bit too common.
6 posts - 3 participants