This paper is dedicated to studying matrix solutions of the cubic Szegő equation on the real line, which is introduced in Pocovnicu [Anal PDE 4(3):379–404, 2011; Dyn Syst A 31(3):607–649, 2011] and Gérard–Pushnitski (Commun Math Phys 405:167, 2024), leading to the following cubic matrix Szegő equation on \({\mathbb {R}}\) , \(\begin{aligned} i \partial _t U = \Pi _{\ge 0} \left( U U ^* U \right) , \quad \widehat{\left( \Pi _{\ge 0} U\right) }(\xi )= {\textbf{1}}_{\xi \ge 0}{\hat{U}}(\xi )\in {\mathbb {C}}^{M \times N}. \end{aligned}\) Inspired by the space-periodic case in Sun (The matrix Szegő equation, arXiv:2309.12136), we establish its Lax pair structure via double Hankel operators and Toeplitz operators. Then the explicit formula in Gérard–Pushnitski (Commun Math Phys 405:167, 2024) can be extended to two equivalent formulas in the matrix equation case, which both express every solution explicitly in terms of its initial datum and the time variable.