# \`vcat(\[\], \[1 2\])\` # OK. \`vcat(\[\], \[1 "2"\])\` # Not OK

**URL:** <https://discourse.julialang.org/t/vcat-1-2-ok-vcat-1-2-not-ok/112991>\
**Category:** General Usage\
**Tags:** question, syntax, cat\
**Created:** [April 16, 2024, 5:28am UTC](https://discourse.julialang.org/t/vcat-1-2-ok-vcat-1-2-not-ok/112991 "2024-04-16T05:28:55Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![WuSiren](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wusiren/32/42529_2.png) [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Post date:** [April 16, 2024, 7:53am UTC](https://discourse.julialang.org/t/vcat-1-2-ok-vcat-1-2-not-ok/112991/3 "2024-04-16T07:53:33Z")

</div>

> [@Can't concatenate a matrix to \`Any\[\]\` horizontally](https://discourse.julialang.org/t/cant-concatenate-a-matrix-to-any-horizontally/112152):
>
> Block1: a = [] b = [1 2; 3 4] a = vcat(a, b) # or a = [a; b] Block2: a = [] b = [1 2; 3 4] a = hcat(a, b) # or a = [a b] Question: Block1 works but Block2 doesn’t. Why?

Thanks. Maybe it is due to Julia version as the post above. Sorry… I was just looking for an approach to recording some process results in a loop. May I ask for some good advice on the following code?

```julia
rec = []
for i = 1:10
    rec = cat(rec, rand(3)'; dims=1)
end
rec

```

Thanks again. 🤝 🤝

---

_[View the full topic](https://discourse.julialang.org/t/vcat-1-2-ok-vcat-1-2-not-ok/112991)._
