# Extract from a cartesian index

**URL:** <https://discourse.julialang.org/t/extract-from-a-cartesian-index/88062>\
**Category:** General Usage\
**Created:** [September 30, 2022, 8:54pm UTC](https://discourse.julialang.org/t/extract-from-a-cartesian-index/88062 "2022-09-30T20:54:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ejlongman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ejlongman/32/36801_2.png) [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Post date:** [September 30, 2022, 8:54pm UTC](https://discourse.julialang.org/t/extract-from-a-cartesian-index/88062/1 "2022-09-30T20:54:59Z")

</div>

Hello!

I am looking to extract the coordinates from this array of cartesian indexes in the lokmax vector.

```julia
lokmax = vec(findmax(bellman,dims=1)[2]) 

```

resulting in

```julia
CartesianIndex{2}[CartesianIndex(3, 1), CartesianIndex(3, 2), CartesianIndex(3, 3), CartesianIndex(3, 4)]

```

The MWE is:

```julia
lokmax[1][1]

```

which gives me one coordinate from one point:

```julia
3

```

but I would like all of them. Does anyone know how to do this? Thanks!

---

<div class="post-metadata">

**Author:** ![ejlongman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ejlongman/32/36801_2.png) [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Post date:** [September 30, 2022, 9:04pm UTC](https://discourse.julialang.org/t/extract-from-a-cartesian-index/88062/2 "2022-09-30T21:04:12Z")

</div>

Wait I solved my own issue. For anyone else looking:

Tuple.(lokmax)
