How do I filter out a row in a cell array
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Joel Abrahams
am 16 Jul. 2017
Beantwortet: Akira Agata
am 16 Jul. 2017
I have a 83x10 cell array. I want to filter the rows by a certain column value, namely whether a column is empty or not (by empty I mean it has the `[]` value).
How do I do this?
0 Kommentare
Akzeptierte Antwort
Akira Agata
am 16 Jul. 2017
You can do this with cellfun function, like:
% 83x10 sample cell array
C = num2cell(rand(83,10));
% Set some empty cell
C(2,3) = {''};
C(5,2) = {''};
% Identify empty cells
idx = cellfun(@isempty, C);
% Delete rows with empty cell
C(any(idx,2),:) = [];
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Cell Arrays 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!