## How to combine multiple columns into a single column?

### Cloris (view profile)

on 18 Apr 2014
Latest activity Commented on by sania sss

### sania sss (view profile)

on 26 Feb 2015
Accepted Answer by Azzi Abdelmalek

### Azzi Abdelmalek (view profile)

I have a dataset of 12 rows and 163 columns, but how can I make convert it into a single column? e.g., [1 2 3 4; 5 6 7 8; 9 1 2 3; 4 5 6 7; 8 9 1 2; 3 4 5 6]

This is a 6x4 matrix, how can convert it to a single column like 1 5 9 4 8 3 2 6 1 5 9 4 3 7 2 6 1 5 4 8 3 7 2 6

But note that I have 163 columns in reality, so is there any general method to convert 163 columns to a single column? Thanks.

## Products

No products are associated with this question.

### Azzi Abdelmalek (view profile)

Answer by Azzi Abdelmalek

### Azzi Abdelmalek (view profile)

on 18 Apr 2014
Edited by Azzi Abdelmalek

### Azzi Abdelmalek (view profile)

on 18 Apr 2014
```A=[ 1 2 3 4
5 6 7 8
9 1 2 3]
out=A(:)
```

or

```out=reshape(A,[],1)
```

Cloris

### Cloris (view profile)

on 18 Apr 2014

Thank you so much！

sania sss

### sania sss (view profile)

on 26 Feb 2015

sir i have one doubt .. pls answer as soon as possible, if i run the ofdm program in matlab, scatter plot of the qam modulation is varying ,, means if i run the program first time, all the signal point is cuming , if i run next time, signal point is missing in scatterplot.... it is not in constant mode... please suggest me sir...mail me saniasss212@gmail.com

### Mischa Kim (view profile)

Answer by Mischa Kim

### Mischa Kim (view profile)

on 18 Apr 2014
Edited by Mischa Kim

### Mischa Kim (view profile)

on 18 Apr 2014

Cloris, use reshape

` datacol = reshape(data, 12*163, [])`

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi