# Finding Position of Element in an Array

**URL:** <https://discourse.julialang.org/t/finding-position-of-element-in-an-array/12502>\
**Category:** General Usage\
**Tags:** question\
**Created:** [July 19, 2018, 4:25pm UTC](https://discourse.julialang.org/t/finding-position-of-element-in-an-array/12502 "2018-07-19T16:25:22Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 20, 2018, 8:30am UTC](https://discourse.julialang.org/t/finding-position-of-element-in-an-array/12502/9 "2018-07-20T08:30:18Z")

</div>

You can convert, something like

```julia
julia> v = rand(3,3);

julia> C = findall(x->x>0.5, v)
5-element Array{CartesianIndex{2},1}:
 CartesianIndex(2, 1)
 CartesianIndex(2, 2)
 CartesianIndex(3, 2)
 CartesianIndex(2, 3)
 CartesianIndex(3, 3)

julia> L = LinearIndices(v)
3×3 LinearIndices{2,Tuple{Base.OneTo{Int64},Base.OneTo{Int64}}}:
 1 4 7
 2 5 8
 3 6 9

julia> L[C]
5-element Array{Int64,1}:
 2
 5
 6
 8
 9

```

---

_[View the full topic](https://discourse.julialang.org/t/finding-position-of-element-in-an-array/12502)._
