MATLAB: Delete multiple rows from array

arraydeleteMATLABrows

I need to delete multiple rows from an array. I know I cannot use a loop because the size of the array will change.
Does anyone have any suggestions on how to accomplish this?
UPDATED: For example, if I have an array such as:
1 9 0
2 1 2
5 8 3
7 1 0
Depending on if the 3rd column is a 0 (I used num2cell, so I'm not sure what type that makes each item in the cells), then I want to delete the whole row. So in the above example,
1 9 0
7 1 0
Would both be deleted, and the array would then only be a 2×3 array.
Thanks in advance! Let me know if I need to add more details. -Matt

Best Answer

Two possible approaches are:
array( v3==0, : ) = [];
and
for ii = size( array, 1 ) : -1 : 1
if v3{ii}==0
array( ii, : ) = [];
end
end
Loop from bottom up seems to be the simplest way, if the array is not too big.
========================= UPDATE
Yes, it is possible to use v3. However, it "smells". My point was to loop from bottom up, which I thought was appropriate to point out since you excluded looping.
The code below does what I think you are asking for
num = [
1 9 0
2 1 2
5 8 3
7 1 0 ];
cac = num2cell( num );
ca1 = cellfun( @(x) num2str(x), cac, 'uni', false );
iscellstr( ca1 )
ca2 = ca1;
for ii = size( ca1, 1 ) : -1 : 1
if strcmp( ca1(ii,3), '0' )
ca1( ii, : ) = [];
end
end
ca2( strcmp( ca2(:,3), '0' ), : ) = [];
strcmp( ca1, ca2 )
all( strcmp( ca1, ca2 ) )
all( all( strcmp( ca1, ca2 ) ) )