MATLAB: Making one column from two columns

.txt filesarrayone column from two column

Hello;
I would like to build a column ( C) that is created by two different columns ( A and B) in text file in a specific array. For example;
A B
10 15
20 25
30 35
40
C
10
15
20
25
30
35
40
How can I achieve this? Thank you.
Muhsin

Best Answer

B1 = [B;0];
out = reshape([A(:)';B1(:)'],[],1);
out = out(1:end-1);