vcat
vcat(A...)
Concatenate along dimension 1
Examples
julia> foo = Array(Int8,2,2)
2x2 Array{Int8,2}:
2 0
0 0
julia> bar = Array(Int8,2,2)
2x2 Array{Int8,2}:
-93 -111
62 5
julia> vcat(foo,bar) # equivalent to [foo; bar]
4x2 Array{Int8,2}:
2 0
0 0
-93 -111
62 5
# Concatenate arrays vertically along dimension 1
julia> A = [1 2 3; 4 5 6]
2×3 Array{Int64,2}:
1 2 3
4 5 6
julia> B = [7 8 9]
1×3 Array{Int64,2}:
7 8 9
julia> C = [10 11 12; 13 14 15]
2×3 Array{Int64,2}:
10 11 12
13 14 15
julia> D = vcat(A, B, C)
5×3 Array{Int64,2}:
1 2 3
4 5 6
7 8 9
10 11 12
13 14 15
In this example, vcat
is used to vertically concatenate arrays A
, B
, and C
along dimension 1, resulting in a new array D
. The resulting array D
has 5 rows and 3 columns.
Note that vcat
can be used with any number of arrays, separated by commas. This allows for concatenation of multiple arrays in a single function call.
See Also
User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.