MATLAB: Consider only a positive numbers of the first columns.

fist columns;

I have this matrix:
A =
-0.0001 -0.0723 0.0007 0.0013 -0.0007 -0.0016 -0.0009 0.0010 -0.0018
-0.0004 -0.0723 0.0008 0.0012 -0.0008 -0.0017 -0.0009 0.0011 -0.0017
-0.0005 -0.0723 0.0007 0.0013 -0.0008 -0.0017 -0.0009 0.0011 -0.0017
0.0002 -0.0723 0.0007 0.0012 -0.0007 -0.0017 -0.0009 0.0010 -0.0018
-0.0003 -0.0723 0.0006 0.0012 -0.0007 -0.0017 -0.0009 0.0011 -0.0017
0.0005 -0.0723 0.0007 0.0013 -0.0007 -0.0017 -0.0009 0.0011 -0.0017
My issue is to by-pass (or not consider) the rows that start with a negative number in the first column. How can I extend this procedure if I work with cell or struct variable? How can I do it?

Best Answer

Use
B = A(find(A(:,1)>0),:)
Concerning your second question: that, of course, depends on how your cell array looks like. In general, you could convert to a numeric array and then use the code above.