MATLAB: Combine two cell arrays

cell arrays

I have two cell arrays:
X{1,1}=[18;21;17;20;19];
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
How to create new cell array like this:
Z=[X{1,1}(:,:) X{1,2}(:,:)]

Best Answer

Maybe you want
X=[num2cell([18;21;17;20;19]) cellstr(['m';'f';'m';'m';'f'])]