# Change MeshGrids to Arrays

**URL:** <https://discourse.julialang.org/t/change-meshgrids-to-arrays/115856>\
**Category:** New to Julia\
**Tags:** question, mesh\
**Created:** [June 19, 2024, 12:58pm UTC](https://discourse.julialang.org/t/change-meshgrids-to-arrays/115856 "2024-06-19T12:58:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Cyan](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Post date:** [June 19, 2024, 12:58pm UTC](https://discourse.julialang.org/t/change-meshgrids-to-arrays/115856/1 "2024-06-19T12:58:14Z")

</div>

I have two mesh grid `xg =5×5 LazyGrids.GridUR{Int64, 1, 2}: [1 1 1 1 1; 2 2 2 2 2; 3 3 3 3 3; 4 4 4 4 4; 5 5 5 5 5]`  
and `yg =5×5 LazyGrids.GridUR{Int64, 1, 2}: [1 1 1 1 1; 2 2 2 2 2; 3 3 3 3 3; 4 4 4 4 4; 5 5 5 5 5]`,  
How can I change these two meshs into position coordinates like `(1,1), (1,2)..., (1,5), ..., (5,5)` ?

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [June 19, 2024, 1:12pm UTC](https://discourse.julialang.org/t/change-meshgrids-to-arrays/115856/2 "2024-06-19T13:12:52Z")

</div>

> [@Cyan](#):
>
> How can I change these two meshs into position coordinates like `(1,1), (1,2)..., (1,5), ..., (5,5)` ?

`collect(zip(xg,yg))`?

(There is probably a better way to approach your problem that doesn’t involve explicitly materializing this array, but without more context it’s hard to give better advice.)

---

<div class="post-metadata">

**Author:** ![Cyan](https://avatars.discourse-cdn.com/v4/letter/c/278dde/32.png) [@Cyan](https://discourse.julialang.org/u/Cyan)\
**Post date:** [June 19, 2024, 1:28pm UTC](https://discourse.julialang.org/t/change-meshgrids-to-arrays/115856/3 "2024-06-19T13:28:24Z")

</div>

Thanks, this is what I want 😀
