Consider two tables:
tab1=Flatten[Table[{i,j,0},{i,0.5,0.7,0.1},{j,0.1,0.3,0.1}],{1,2}];
tab2=Flatten[Table[{i,j,i*j},{i,0.5,0.7,0.2},{j,0.1,0.3,0.2}],{1,2}];
These tables have a common subset of the first and second elements of their rows: e.g., {0.5,0.1}
, and {0.7,0.3}
. How to make a table from tab1
where zeros (the third element) in the rows from the common subset are replaced with the corresponding values from tab2
?