How to concatenate string cell arrays?
Afficher commentaires plus anciens
I have 2 string cells arrays (a 1 X 191 cell array and a 5 X 1 cell array). How can I concatenate the two so I have a 955 X 1 cell array that starts with Raw intensity mean (191 times), Gray mean ws=3 mean (191 times), etc. for all 191 cells.


Réponses (1)
Abdolkarim Mohammadi
le 22 Nov 2020
0 votes
What you need is the Cartesian product of the two sets. MATLAB does not have built-in function, but there are several functions on FEX.
2 commentaires
Nandini Chatterjee
le 22 Nov 2020
Abdolkarim Mohammadi
le 22 Nov 2020
Modifié(e) : Abdolkarim Mohammadi
le 22 Nov 2020
You can have it work for strings by editing the function. For example, you change
X = zeros (...);
to
X = strings (...);
I think no other change is needed. Or you can use another FEX function.
As I mentioned, there are several functions for this on FEX. You can get them by googling "matlab cartesian product".
Catégories
En savoir plus sur Matrices and Arrays 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!