Skip to content

Commit 0e498d3

Browse files
committed
Added doctest for hvcat
Removed test for a non-working example and added clearer doctest example instead.
1 parent 3d132a9 commit 0e498d3

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

base/docs/helpdb.jl

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3792,7 +3792,34 @@ utf8(s)
37923792
doc"""
37933793
hvcat(rows::Tuple{Vararg{Int}}, values...)
37943794
3795-
Horizontal and vertical concatenation in one call. This function is called for block matrix syntax. The first argument specifies the number of arguments to concatenate in each block row. For example, `[a b;c d e]` calls `hvcat((2,3),a,b,c,d,e)`.
3795+
Horizontal and vertical concatenation in one call. This function is called for block matrix syntax. The first argument specifies the number of arguments to concatenate in each block row.
3796+
3797+
```jldoctest
3798+
julia> a, b, c, d, e, f = 1, 2, 3, 4, 5, 6
3799+
(1,2,3,4,5,6)
3800+
3801+
julia> [a b c; d e f]
3802+
2x3 Array{Int64,2}:
3803+
1 2 3
3804+
4 5 6
3805+
3806+
julia> hvcat((3,3), a,b,c,d,e,f)
3807+
2x3 Array{Int64,2}:
3808+
1 2 3
3809+
4 5 6
3810+
3811+
julia> [a b;c d; e f]
3812+
3x2 Array{Int64,2}:
3813+
1 2
3814+
3 4
3815+
5 6
3816+
3817+
julia> hvcat((2,2,2), a,b,c,d,e,f)
3818+
3x2 Array{Int64,2}:
3819+
1 2
3820+
3 4
3821+
5 6
3822+
```
37963823
37973824
If the first argument is a single integer `n`, then all block rows are assumed to have `n` block columns.
37983825
"""

0 commit comments

Comments
 (0)