# How to convert Vector of Vectors to Matrix

**URL:** <https://discourse.julialang.org/t/how-to-convert-vector-of-vectors-to-matrix/72609>\
**Category:** General Usage\
**Tags:** question, arrays\
**Created:** [December 5, 2021, 1:35pm UTC](https://discourse.julialang.org/t/how-to-convert-vector-of-vectors-to-matrix/72609 "2021-12-05T13:35:53Z")\
**Posts on this page:** 1\
**Showing post:** 12

<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:** [January 14, 2022, 11:54pm UTC](https://discourse.julialang.org/t/how-to-convert-vector-of-vectors-to-matrix/72609/12 "2022-01-14T23:54:07Z")

</div>

> [@PaulN](#):
>
> I noticed that I ran into a problem when there were more than 10,000 elements… Is there a workaround for this limitation? (Code would fail if I had 10,001 vector of vectors)

**Don’t use splatting** (`...`) of large arrays, e.g. _don’t_ use things like `hcat(x...)`. Use `reduce`, e.g. `reduce(hcat,x)` as suggested [above](https://discourse.julialang.org/t/how-to-convert-vector-of-vectors-to-matrix/72609/6).

_Update:_ In Julia 1.9 or later, use the [`stack`](https://docs.julialang.org/en/v1/base/arrays/#Base.stack) function, e.g. `stack([[1,0,1],[0,0,1]], dims=1) == [1 0 1 ; 0 0 1]`.

---

_[View the full topic](https://discourse.julialang.org/t/how-to-convert-vector-of-vectors-to-matrix/72609)._
