  Let $H$ be a simple undirected graph. The family of all matchings of $H$
forms a simplicial complex called the matching complex of $H$. Here , we give a
classification of all graphs with a Gorenstein matching complex. Also we study
when the matching complex of $H$ is Cohen-Macaulay and, in certain classes of
graphs, we fully characterize those graphs which have a Cohen-Macaulay matching
complex. In particular, we characterize when the matching complex of a graph
with girth at least 5 or a complete graph is Cohen-Macaulay.
