Categorical cell array reshaping
Afficher commentaires plus anciens
Dear All
I have a cell array (2x7) of 1x1 categorical arrays that looks like below
1 0 0 0 0 1 0
1 1 1 1 0 1 0
I like to combine this into a 1x7 cell array of categories so it looks like below
1;1 0;1 0;1 0;1 0;0 1;1 0;0
Anyone have any ideas how to do this. Help is highly appreciated.
Cheers Mads
3 commentaires
Guillaume
le 18 Août 2018
What is a categorical cell array? A cell array of 1x1 categorical arrays? something else?
Please use valid matlab syntax for your example to remove ambiguities.
MB Sylvest
le 18 Août 2018
Image Analyst
le 11 Juil 2019
Original question in case user edits it away:
Dear All
I have a cell array (2x7) of 1x1 categorical arrays that looks like below
1 0 0 0 0 1 0
1 1 1 1 0 1 0
I like to combine this into a 1x7 cell array of categories so it looks like below
1;1 0;1 0;1 0;1 0;0 1;1 0;0
Anyone have any ideas how to do this. Help is highly appreciated.
Cheers Mads
Réponse acceptée
Plus de réponses (1)
Yuvaraj Venkataswamy
le 18 Août 2018
if true
X=your_categoricalArray;
Y=double(X); % your answer
end
Catégories
En savoir plus sur Categorical 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!