'Replaces Function F in Matrix entries with Function G.
Examples
>>> from sympy import symbols, Function, Matrix
>>> F, G = symbols(\'F, G\', cls=Function)
>>> M = Matrix(2, 2, lambda i, j: F(i+j)) ; M
Matrix([
[F(0), F(1)],
[F(1), F(2)]])
>>> N = M.replace(F,G)
>>> N
Matrix([
[G(0), G(1)],
[G(1), G(2)]])'

def replace(self, F, G, map=False):

    return self.applyfunc((lambda x: x.replace(F, G, map)))
