# How to combine two column data into one matrix?

**URL:** https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706
**Category:** General Usage
**Tags:** question
**Created:** [September 24, 2021, 4:08pm UTC](https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706 "2021-09-24T16:08:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [September 24, 2021, 4:08pm UTC](https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706/1 "2021-09-24T16:08:40Z")

</div>

For example, I have two column data:  
A = [1;2;3];  
B = [5;6;7];

In order to make a matrix with the first column being A and 2nd Column being B, I would do this in Matlab:  
C = [A, B];

But it does it the wrong way and I got the below matrix instead:  
[1, 2, 3]  
[4, 5, 6]

How do I do this simple task?

Many thanks.

---

<div class="post-metadata">

### Author: ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)
#### Post date: [September 24, 2021, 4:09pm UTC](https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706/2 "2021-09-24T16:09:16Z")

</div>

You want `[A B]`, without the comma.

---

<div class="post-metadata">

### Author: ![leon](https://avatars.discourse-cdn.com/v4/letter/l/dc4da7/32.png) [@leon](https://discourse.julialang.org/u/leon)
#### Post date: [September 24, 2021, 4:16pm UTC](https://discourse.julialang.org/t/how-to-combine-two-column-data-into-one-matrix/68706/3 "2021-09-24T16:16:37Z")

</div>

Awesome. Many thanks for the quick reply!
