# Concatenation arguments

**URL:** <https://discourse.julialang.org/t/concatenation-arguments/62676>\
**Category:** New to Julia\
**Created:** [June 10, 2021, 1:23pm UTC](https://discourse.julialang.org/t/concatenation-arguments/62676 "2021-06-10T13:23:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![JeanFrancois](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeanfrancois/32/25968_2.png) [@JeanFrancois](https://discourse.julialang.org/u/JeanFrancois)\
**Post date:** [June 10, 2021, 1:23pm UTC](https://discourse.julialang.org/t/concatenation-arguments/62676/1 "2021-06-10T13:23:40Z")

</div>

I do not understand the difference between :

_# applying hcat to a vector_  
hcat( [hcat(Gray.(Float64.(rand(10)))) for \_ in 1:10] )

and  
_# applying hcat to a list of arguments, using the splat operator_  
begin  
vecs = [hcat(Gray.(Float64.(rand(10)))) for \_ in 1:10]  
hcat(vecs…)  
end

---

<div class="post-metadata">

**Author:** ![gbaraldi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gbaraldi/32/22101_2.png) [@gbaraldi](https://discourse.julialang.org/u/gbaraldi)\
**Post date:** [June 10, 2021, 3:09pm UTC](https://discourse.julialang.org/t/concatenation-arguments/62676/2 "2021-06-10T15:09:26Z")

</div>

Hcat takes its arguments and concatenates them horizontally. When you pass multiple vectors to hcat it will create a matrix with each vector as its columns. It does exactly this when you only pass a single vector, creating a Nx1 Matrix.

When you use the splat operator it separates the vector into its components and concatenates them creating I.e a row vector.

```julia
julia> hcat(rand(10))
10×1 Matrix{Float64}

julia> hcat(rand(10)...)
1×10 Matrix{Float64}

```

Since your vector is made of 10x1 matrices it creates a 10x10 matrix.
