I have a matrix (tab1) made out of lines with three elements. Occasionally some of these elements are non-numeric. In these cases, I would like to assign the value 0 to them. I managed to program such an operation when the third element (z3) is non-numeric:
tab2 = tab1 /. {z1_, z2_, z3_} /; ! NumericQ[z3] -> {z1, z2, 0}
How to make this line of code more generic and attribute the value 0 to second (z2) and third (z3) elements that are non-numeric? Or to any non-numeric element?
thanks