Finding/counting logical ones in a cell array
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Levente Gellért
am 30 Jun. 2021
Kommentiert: Levente Gellért
am 30 Jun. 2021
Dear Experts, I am trying to count , how many logical ones I have in my cell array.
I was trying these way's:
idx = find([mycell{:}] == 1);
idx=cellfun(@(c)any(c==1),mycell);
idx=cellfun(@(c)any(c>0),mycell);
These do not work.
Please, find a example cell array attached and share your opinions!
MAny thanks
lg
0 Kommentare
Akzeptierte Antwort
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Operators and Elementary Operations 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!