How can I convert a matrix to a list in Mathematica?

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 2K views
johnobono
Messages
2
Reaction score
0
Hi everyone:

I would like to join all elements of on matrix into just one list:

matrix =
1 2 3
4 5 6
7 8 9

into

list = {1,2,3,4,5,6,7,8,9}

Anyone has a solution for this?

Thanks
 
Physics news on Phys.org
list = Flatten[matrix]
 
  • Like
Likes   Reactions: johnobono
OMG! Thanks, such a simple solution. I tried a lot of things, such as "For" and "Join", but with no easy result.

Thank you very much!