Your code is incomplete, I did not try it out, but this should fix it:
parfor file=1:length(data(:,1))
line= 1;
length_line = length(data{file,1}(:,1));
dataslice=data{file,1}
while line <= length_line && ... && ...
% some more loops
if (...)
dataslice(line,:) = [];
length_line= length_line - 1;
end
% end of some more loops
line= line + 1;
end
data{file,1}=dataslice
end
% data will be returned
If this does not help, please update your question and provide a reproducable example (initialisation of all variables, complete code)