Combine two cell arrays
Afficher commentaires plus anciens
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}(:,:)]
Réponse acceptée
Plus de réponses (1)
Andrei Bobrov
le 10 Août 2013
Modifié(e) : Andrei Bobrov
le 10 Août 2013
X{1,1}=num2str([18;21;17;20;19]);
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
strcat(X{:})
OR
X{1,1}=num2cell([18;21;17;20;19]);
X{1,2}=cellstr(['m';'f';'m';'m';'f']);
[X{:}]
Catégories
En savoir plus sur Data Types dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!