Chances are this is a very stupid question but I spent a pretty absurd amount of time looking for it on the documentation, to no avail.
in MATLAB, the find() function gi
This might work for you and others who check this out. In order to set elements of a matrix m based on the condition on another matrix A, you can use this notation:
m = (A.array() != 0).select(1, m);
This command replaces those elements in matrix m that have non-zero corresponding elements in A, with one.