cell2mat error in arraycell
조회 수: 3 (최근 30일)
이전 댓글 표시
Sis=app.StrategyAggreg_UITable2.Data(:,3);
xx=logical(cell2mat(Sis));
Error using cell2mat
All contents of the input cell array must be of the same data type.
댓글 수: 0
채택된 답변
추가 답변 (1개)
Matt J
2023년 11월 19일
load Check
xx=cellfun(@logical,Sis)
댓글 수: 1
Walter Roberson
2023년 11월 19일
편집: Walter Roberson
2023년 11월 19일
load Check
classes = cellfun(@class, Sis, 'uniform', 0);
unique_classes = unique(classes)
mask = classes == "logical";
unique([Sis{mask}])
unique([Sis{~mask}])
So Sis contains cells with logical 0 (false) and logical 1 (true), but it also contains cells with numeric 0 and numeric 1.
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!