Hello Tudor, Here is one way:
indx = find(matrix1==0)
matrix2(indx) = 0
This works because 'find' looks at the elements of matrix1 columnwise in a running index from (in this case) 1 to 16, and the second line reads them back in the same way.
In this specific case you could multiply the two matrices by each other elementwise, but that way is a lot less versatile. In general maybe you would want to set the mat2 elements corresponding to mat1 = a to value b and you can't do that with elementwise multiplication.