Assume I have a set of vectors
set = {{0,1,1,0,1}, {1,0,1,1,1}, {1,1,1,1,0},{1,0,0,1,0}}.
I want to delete the vectors which have the last entry as 0. In the above example, it is the 3rd and 4th vectors.
Can I use DeleteCases in a better way than following?
Do[If[set[[j]][[5]] == 0, set[[j]] = ConstantArray[0, Length[set[[1]]]]],
{j, 1, Length[set]}];
set = DeleteCases[set, ConstantArray[0, Length[set[[1]]]]];