Let's suppose I have a matrix A=
1 2 3;
4 5 6;
7 8 9
and a matrix B=
1 NaN 3;
NaN 5 6;
7 NaN NaN
I want to cancel the same elements that are canceled in matrix B. It would be:
A2=
1 NaN 3;
NaN 5 6;
7 NaN NaN
How can I do that?