A matrix is a rectangular array of numbers or expressions arranged in rows and columns. It is represented by brackets and commas. A matrix can be a row matrix, column matrix, square matrix, unit matrix, diagonal matrix, scalar matrix, or zero matrix depending on its elements and dimensions. A square matrix has the same number of rows and columns while other matrix types have specific properties for their elements.