cell2mat error in arraycell
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Luca Re
am 18 Nov. 2023
Bearbeitet: Walter Roberson
am 19 Nov. 2023
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 Kommentare
Akzeptierte Antwort
Weitere Antworten (1)
Matt J
am 19 Nov. 2023
load Check
xx=cellfun(@logical,Sis)
1 Kommentar
Walter Roberson
am 19 Nov. 2023
Bearbeitet: Walter Roberson
am 19 Nov. 2023
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.
Siehe auch
Kategorien
Mehr zu Elementary Math finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!