Merging the Cell Array Elements

1 vue (au cours des 30 derniers jours)
tinkyminky93
tinkyminky93 le 7 Juin 2022
Commenté : tinkyminky93 le 7 Juin 2022
Hello,
I have a cell array which has the dimensions of 64x1 cell. I try to take the first 2 element then merge them. I tried horzcat and vertcat but they do not solve my problem completely. How can I do it?
64x1 cell
FF
01
FF
01
FF
01
...
I want my cell array to be 32x1 like
'FF01'
'FF01'
'FF01'
....
..
Thank you for your help.

Réponse acceptée

Matt J
Matt J le 7 Juin 2022
C=string(reshape(yourCell,2,[])');
out=cellstr( C(:,1)+C(:,2) );
  1 commentaire
tinkyminky93
tinkyminky93 le 7 Juin 2022
Great job! Thank you sir.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by