The matrix of an igneous rock consists of finer-grained, often microscopic, crystals in which larger crystals, called phenocrysts, are embedded. This porphyritic texture is indicative of multi-stage cooling of magma. For example, porphyritic andesite will have large phenocrysts of plagioclase in a fine-grained matrix. Also in South Africa, diamonds are often mined from a matrix of weathered clay-like rock (kimberlite) called "yellow ground".
The matrix of sedimentary rocks is finer-grained sedimentary material, such as clay or silt, in which larger grains or clasts are embedded. It is also used to describe the rock material in which a fossil is embedded.