MATLAB: Remove row in cell array depending on value of first column.

cell arrayremove row

I would like to know how to remove each row on each cell in a cell array where the value of the first column is below 6.
I’ve got this cell array with hundreds of cells where each cell is a matrix of a different dimension. The fist 8 cells look like:
C = {36x4 double}
{5x18 double}
{5x2 double}
{13x9 double}
{2x7 double}
{20x2 double}
{20x2 double}
{9x7 double}
For example the third cell of C is {5×2 double} and is composed of:
1 5
19 10
5 4
6 6
21 9
So the end result for that cell should be:
19 10
6 6
21 9

Best Answer

result = cellfun(@(z) z(z(:,1)>=6,:) , C ,'uni',0)