Collect positive coordinates of a vector in a vector

15 Views Asked by At

I have a vector of nonnegative naturals $x \in \mathbb N_0^n$. I want to collect the positive coordinates of $x$ in $y$. I have a sloppy definition $y = (x_i: x_i > 0, i=1,\ldots,n)$. Is this legitimate? Example: if $x = (1,0,3)$, then $y = (1,3)$ should result (the order is also important).