What is a matrix?

A matrix is a two-dimensional array of objects. An element of a matrix can be an object of any type. However, most problems in data science need matrices with only real numbers as their elements. Therefore, we’ll also work with matrices that only have real numbers as their elements, unless stated otherwise. A matrix is typically denoted as an uppercase letter with subscripts. The subscripts describe the order of the matrix. For example, a matrix of order m×nm \times n can be denoted as Am×nA_{m \times n}. Here, mm is the number of rows and nn is the number of columns. For example, a two-dimensional array with three rows and two columns is denoted as A3×2A_{3 \times 2}.

Get hands-on with 1200+ tech skills courses.