The matrix of an igneous rock consists of finer-grained, often microscopic, crystals in which larger crystals (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.
All sediments are at first in an incoherent condition (e.g. sands, clays and gravels, beds of shells), and they may remain in this state for an indefinite period. Millions of years have elapsed since some of the early Tertiary strata gathered on the ocean floor, yet they are quite friable (e.g. the London Clay) and differ little from many recent accumulations. There are few exceptions to the rule that with increasing age sedimentary rocks become more and more indurated. Generally, the older the strata the more likely it is that they will have the firm consistency generally implied in the term "rock".
The pressure of newer sediments on underlying masses is apparently one cause of this hardening, though not in itself a very powerful one. More efficiency is generally ascribed to the action of percolating water, which takes up water soluble materials and then redeposits them in pores and cavities. This operation is probably accelerated by the increased pressure produced by superincumbent masses, and to some extent also by the rise of temperature which inevitably takes place in rocks buried to some depth beneath the surface. The rise of temperature, however, may be only a tiny increase; we know more than one instance of sedimentary deposits which have been buried beneath four or five miles of similar strata (e.g. parts of the Old Red Sandstone), and yet no perceptible difference is apparent between beds of similar composition at the top of the series and near its base. Should the deposits have been truly "baked", that is, subject to a large increase in temperature, then differences would be evident.
The redeposited cementing material is most commonly calcareous or siliceous. Limestones, which were originally a loose accumulation of shells, corals, etc., become compacted into firm rock in this manner; and the process often takes place with surprising ease, as for example, in the deeper parts of coral reefs, or even in wind-blown masses of shelly sand exposed merely to the action of rain. The cementing substance may be regularly deposited in crystalline continuity on the original grains, where these were crystalline, and even in sandstones (such as Kentish rag), a crystalline matrix of calcite often envelops the sand grains. The change of aragonite to calcite and of calcite to dolomite, by forming new crystalline masses in the interior of the rock, usually also accelerates consolidations. Silica is less easily soluble in ordinary waters, but even this ingredient of rocks is dissolved and redeposited with great frequency. Many sandstones are held together by an infinitesimal amount of colloid or cryptocrystalline silica; when freshly dug from the quarry they are soft and easily trimmed, but after exposure to the air for some time they become much harder, as their siliceous cement sets and passes into a rigid condition. Others contain fine scales of kaolin or of mica. Argillaceous materials may be compacted by mere pressure, like graphite and other scaly minerals.