# Itertating a 2D matrix

**URL:** <https://forum.elixirforum.com/t/itertating-a-2d-matrix/50849>\
**Category:** Questions\
**Tags:** matrix, learning-elixir, list, help, 2d-arrays\
**Created:** [October 7, 2022, 8:56pm UTC](https://forum.elixirforum.com/t/itertating-a-2d-matrix/50849 "2022-10-07T20:56:38Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Anshul-13J](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/anshul-13j/32/28023_2.png) [@Anshul-13J](https://forum.elixirforum.com/u/Anshul-13J)\
**Post date:** [October 7, 2022, 9:22pm UTC](https://forum.elixirforum.com/t/itertating-a-2d-matrix/50849/5 "2022-10-07T21:22:38Z")

</div>

Gave it a try but still not working!

```elixir
iex(12)> Enum.each(list1, fn row -> ...(12)> Enum.reduce(row, fn x, final_list -> final_list = [final_list | x] end) 
...(12)> end
...(12)> )
warning: variable "final_list" is unused (there is a variable with the same name in the context, use the pin operator (^) to match on it or prefix this variable with underscore if it is not meant to be used)
  iex:13

:ok
iex(13)> final_list
[]

```

---

_[View the full topic](https://forum.elixirforum.com/t/itertating-a-2d-matrix/50849)._
