c and z are equal-sized lists. Whichever elements in z meet a certain criterion, I want a list of the corresponding elements from c. This is the clunky way I came up with:
c = RandomComplex[{-1 - I, 1 + I}, 20];
z = Abs[(((c^2 + c)^2 + c)^2 + c)^2 + c];
keepc = {};
Do[
If[z[[k]] <= 2, AppendTo[keepc, c[[k]]]], {k, 1, Length[c]}];
keepc
What would be the proper way?