Categorical cell array reshaping
이전 댓글 표시
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
Guillaume
2018년 8월 18일
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
2018년 8월 18일
Image Analyst
2019년 7월 11일
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
채택된 답변
추가 답변 (1개)
Yuvaraj Venkataswamy
2018년 8월 18일
if true
X=your_categoricalArray;
Y=double(X); % your answer
end
카테고리
도움말 센터 및 File Exchange에서 Categorical Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!