MATLAB does not yet have a built-in function for computing Green's function. That being said, you can use the Symbolic Math Toolbox for implementing Green's function. Please refer to the following link for more information on this product:
Here is a list of functions within the Symbolic Math toolbox which might be helpful in your implementation:
"dirac" function:
"dsolve" function (in combination with the "diff" function):
"syms" function (you will need this to create your symbolic function):
You also can take a look at the following functions which do not require a specific toolbox:
"ode":
