I have a problem at the moment where I have a matrix of coordinates: $$z=\begin{pmatrix}x_1 & x_2 & x_3 & ...\\y_1 & y_2 & y_3 & ...\end{pmatrix}$$ and I want a system where it will only add the vector $\begin{pmatrix}x_i\\y_i\end{pmatrix}$ to the end of a new matrix $Z$ if $y_i<0$ so for example: $$\begin{pmatrix}1&2&3&4\\-1&1&-1&1\end{pmatrix}\to\begin{pmatrix}1&3\\-1&-1\end{pmatrix}$$
Ive seen people use things like $Z=z(z<1)$ for vectors but I can't seem to translate this to a matrix