MATLAB: Remove rows usig cellfun

.csv filecellfunremove rowstextscan

Hello,
Neg is 1×8 cell. Each cell column has 101096 data, i.e. length(Neg{1,1}) is 101096. All data are numbers. I need to find the following values: 999.9, 99.9 or 99999 and delete that row in all cell columns.
To do a), I tried this:
fid = fopen('Neg.csv');
Neg = textscan(fid, '%*d %d %d %d %d %*d %*d %*d %d %f %f %f %*[^\n]', ...
'HeaderLines', 1, 'Delimiter', '\t');
fclose(fid);
clear ans fid
Neg(cellfun(@(x) any(x == 999.9), Neg)) = [];
or
Neg(any(cellfun(@(x) any(x==999.9),Neg),2),:) = [];
or
Neg(cellfun(@(x) x==999.9, Neg, 'UniformOutput', false), :) = [];
but it doesn't work. I tried it for 999.9 only because I don't know how to specify several conditions (99999 or 999.9 or 99.9).
Attached is a sample of the file.
Please could you help me with this?
Thanks in advance!
DjR

Best Answer

It seems to be all numeric, so use cell2mat and do everything on it as a double array.
You can get a logical array of the indices that meet your requirements with:
Idx = cellfun(@(x) (x == 99.9), Neg, 'Uni',0);
but you can’t go farther with cell functions.