MATLAB: How to eliminated the first negative element

negative element;

With this variable:
A =
Columns 1 through 4
[1000x9 double] [1000x9 double] [1000x9 double] [1000x9 double]
Columns 5 through 8
[1000x9 double] [1000x9 double] [1000x9 double] [1000x9 double]
My issue is to by-pass (or not consider) the rows that start with a negative number in the first column. I want treat the 8 different arrays as independent ones with regards to ignoring rows that start with a negative number in the first column?. As anyone have an idea?

Best Answer

Assuming you want to delete the rows in which the first column is negative, then this should do the trick:
% Fill in some fake data
A = cell(1,8);
for i = 1:8
A{i} = rand(1000,9) - 0.5;
end
% Create a cell array where the matrices have the leading-negative rows deleted
B = cellfun(@(x) x(x(:,1)>=0,:), A, 'UniformOutput', false)