How to stack vectors to make a matrix?

Say I have two vectors of the same size and I would like to stack them together to form a matrix, what’s the function to perform that?

x = [1,2,3]
y = [4,5,6]
z = [7,8,9]
xy = zeros(Int64,2,3)
xy[1,:] = x
xy[2,:] = y
xy

I know that this will work, but is there a more efficient way? This needs to generalise to stacking n vectors for some n.

julia> x = [1,2,3];

julia> y = [4,5,6];

julia> z = [7,8,9];

julia> vecs = (x, y, z);

julia> vcat(transpose.(vecs)...)
3×3 Array{Int64,2}:
 1  2  3
 4  5  6
 7  8  9
3 Likes