How to get a matrix with the inverse of each element of another matrix?

You can use B = 1 ./ A
Note the dot in front of “/”.