Skip to content

Commit

Permalink
[docs] another example for hcat (JuliaLang#34501)
Browse files Browse the repository at this point in the history
To help avoid confusion from actual use case
  • Loading branch information
dehann authored and JeffBezanson committed Jan 28, 2020
1 parent 4e2a6e7 commit a196a0b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions base/abstractarray.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1539,6 +1539,15 @@ julia> hcat(c...)
1 4
2 5
3 6
julia> x = Matrix(undef, 3, 0) # x = [] would have created an Array{Any, 1}, but need an Array{Any, 2}
3×0 Array{Any,2}
julia> hcat(x, [1; 2; 3])
3×1 Array{Any,2}:
1
2
3
```
"""
hcat(X...) = cat(X...; dims=Val(2))
Expand Down

0 comments on commit a196a0b

Please sign in to comment.