MATLAB: Dealing with Character arrays

charcharactercharacter array

Hello everyone!
I have 3 (Date, Time, Pred) one-column character arrays and i want to create a new array with 3 columns. 1st column —> Date, 2nd column —> Time and 3rd Column —> Pred. but i can't figure how to do that. Can anyone help me?
Thanks in advance,
Giorgos

Best Answer

You probably need a cell array, especially if all the strings are not guaranteed to be of the same size.
col1 = char(reshape(32:127, 32, 3)'); %Some character array
col2 = col1;
col3 = col2;
%What you could use
your_cell_array = [cellstr(col1),cellstr(col2),cellstr(col3)];