MATLAB: How to aggregate two columns

aggregatecolumn

I want to combine two columns. Here is the example of probleme: A column has lot of number like 20100101;20100102… .B column has the same amount of numbers like 020510000;020510040… . I want to aggregate A and B columns to have one column like 2010010120510000;20100102020510040… . That every A(x) would be in the same row with B(x). Thank you very much.

Best Answer

One approach:
A = [20100101;20100102];
B = [020510000;020510040];
ABS = sprintf('%d%09d\n', [A, B]'); % String Representation
ABN = str2num(sprintf('%d%09d\n', [A, B]')) % Numeric Conversion