MATLAB: How to filter out a row in a cell array cell arraysemptyfilter I have a 83×10 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? Best Answer You can do this with cellfun function, like:% 83x10 sample cell arrayC = num2cell(rand(83,10));% Set some empty cellC(2,3) = {''};C(5,2) = {''};% Identify empty cellsidx = cellfun(@isempty, C);% Delete rows with empty cellC(any(idx,2),:) = []; Related SolutionsMATLAB: How to filter rows of a cell based on an empty column Similarly to your previous question, the code will be like:% 100x100 sample cell array with randomly located empty cells C = num2cell(randi(10,100,100));idx = cellfun(@(x) isequal(x,3), C);C(idx) = {''};% Rows where the 8th column is emptyidx = cellfun(@isempty, C(:,8));% Extract the target rowsC1 = C(idx,:);% OthersC2 = C(~idx,:); MATLAB: Convert an 18×1 cell array in a 3×6 cell array reshape(cell_array,3,[]) Related QuestionDelete empty [] {1×7 cell} {1×2 cell}How to remove empty arrays of cellManipulation of a cell array-Getting rid of empty cells in a cell array
Best Answer