For some function, f[x, y]
, I have generated a table of values
Table[f[x, y], {x, {1, 2, 3}}, {y, {1, 2, 3}}]
which generates
{{f[1, 1], f[1, 2], f[1, 3]}, {f[2, 1], f[2, 2], f[2, 3]}, {f[3, 1], f[3, 2], f[3, 3]}}.
However, many of these values are negative or complex; however, these are numerical artifacts, and I want to set them to 0, unless they are positive real.
If I have a large table of this kind, is there a way to set values that are negative or complex to 0?