Matrix fields are becoming increasingly important in digital imaging. In order to perform shape analysis, enhancement or segmentation of such matrix fields, appropriate image processing tools must be developed. This paper extends fundamental morphological operations to the setting of matrices, in the literature sometimes referred to as tensors despite the fact that matrices are only rank two tensors. The goal of this paper is to introduce and explore two approaches to mathematical morphology for matrix-valued data: One is based on a partial ordering, the other utilises nonlinear partial differential equations (PDEs). We start by presenting definitions for the maximum and minimum of a set of symmetric matrices since these notions are the cornerstones of the morphological operations. Our first approach is based on the Loewner ordering for symmetric matrices, and is in contrast to the unsatisfactory component-wise techniques. The notions of maximum and minimum deduced from the Loewner ordering satisfy desirable properties such as rotation invariance, preservation of positive semidefiniteness, and continuous dependence on the input data. These properties are also shared by the dilation and erosion processes governed by a novel nonlinear system of PDEs we are proposing for our second approach to morphology on matrix data. These PDEs are a suitable counterpart of the nonlinear equations known from scalar continuous-scale morphology. Both approaches incorporate information simultaneously from all matrix channels rather than treating them independently. In experiments on artificial and real medical positive semidefinite matrix-valued images we contrast the resulting notions of erosion, dilation, opening, closing, top hats, morphological derivatives, and shock filters stemming from these two alternatives. Using a ball shaped structuring element we illustrate the properties and performance of our ordering-or PDE-driven morphological operators for matrix-valued data.