# How to key-in vertical matrices?

**URL:** <https://discourse.julialang.org/t/how-to-key-in-vertical-matrices/94291>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [February 8, 2023, 6:09pm UTC](https://discourse.julialang.org/t/how-to-key-in-vertical-matrices/94291 "2023-02-08T18:09:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vsoler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vsoler/32/30667_2.png) [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Post date:** [February 8, 2023, 6:09pm UTC](https://discourse.julialang.org/t/how-to-key-in-vertical-matrices/94291/1 "2023-02-08T18:09:35Z")

</div>

A **horizontal matrix** can be keyed-in like this:  
[1 2 3]

A **rectangular matrix** can be keyed-in like this: (“;” denotes new row)  
[1 2 3 ; 4 5 6]

I was expecting a **vertical matrix** to be keyed in like this:  
[1; 2; 3]

However, in the latter case, instead of a Matrix I get a Vector. Does it make any sense?

![Captura](https://global.discourse-cdn.com/julialang/original/3X/3/2/321bee36b270e2f8a13f86191be030e5289465a1.jpeg)

What can I do to get a Matrix as the result?

---

<div class="post-metadata">

**Author:** ![mikmoore](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mikmoore/32/31109_2.png) [@mikmoore](https://discourse.julialang.org/u/mikmoore)\
**Post date:** [February 8, 2023, 6:14pm UTC](https://discourse.julialang.org/t/how-to-key-in-vertical-matrices/94291/2 "2023-02-08T18:14:29Z")

</div>

Repeated semicolons can be used to add extra dimensions or to concatenate in arbitrary dimensions.

```julia-repl
julia> [1; 2; 3;;]
3×1 Matrix{Int64}:
 1
 2
 3

julia> [1; 4;; 2; 5;; 3; 6]
2×3 Matrix{Int64}:
 1 2 3
 4 5 6

```

---

<div class="post-metadata">

**Author:** ![vsoler](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vsoler/32/30667_2.png) [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Post date:** [February 8, 2023, 6:26pm UTC](https://discourse.julialang.org/t/how-to-key-in-vertical-matrices/94291/3 "2023-02-08T18:26:03Z")

</div>

excellent, this is exactly what I needed !!!
