# Concatenating vectors

**URL:** <https://discourse.julialang.org/t/concatenating-vectors/22272>\
**Category:** New to Julia\
**Created:** [March 24, 2019, 2:13pm UTC](https://discourse.julialang.org/t/concatenating-vectors/22272 "2019-03-24T14:13:04Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![DNF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dnf/32/10191_2.png) [@DNF](https://discourse.julialang.org/u/DNF)\
**Post date:** [March 24, 2019, 3:34pm UTC](https://discourse.julialang.org/t/concatenating-vectors/22272/4 "2019-03-24T15:34:55Z")

</div>

> [@angeloaliano1](#):
>
> A = rand(10,10)  
> B = %a empty matrix  
> for i=1:2:10  
> B = [B;A[i,:]] %B is the matrix whose line i is from A, where i is odd  
> end

There’s something very strange about your code snippet, btw. Your comments use `%` which should not work, since the julia character for comments are `#`, and the assignment to `B` has some weird character that I cannot even copy, it seems to be an image of some sort.

It’s great that you got the help you needed, but for future reference, it is preferable if you can provide a full example that can be copied and run, and also that you wrap your example code in triple backticks, as explained here: [Please read: make it easier to help you](https://discourse.julialang.org/t/psa-make-it-easier-to-help-you/14757)

---

_[View the full topic](https://discourse.julialang.org/t/concatenating-vectors/22272)._
