Beyond augmented matrices for linear systems, rectangular arrays of numbers are fundamental entities in their own right. In this section, we define matrices and their basic arithmetic operations.
Special concepts: partitioned matrices, linear combinations, transpose, and trace.
Matrix Notation and Terminology
A matrix is a rectangular array of numbers. The numbers are called entries.
Example: Student study hours (Mon-Sun over 3 subjects) \[
\left[{\begin{array}{c c c c c c c}{2}&{3}&{2}&{4}&{1}&{4}&{2}\\ {0}&{3}&{1}&{4}&{3}&{2}&{2}\\ {4}&{1}&{3}&{1}&{0}&{0}&{2}\end{array}}\right]
\]
Size: Described by rows x columns (e.g., \(3 \times 7\)).
Sum \(A+B\): Obtained by adding corresponding entries. \((A+B)_{ij} = a_{ij} + b_{ij}\).
Difference \(A-B\): Obtained by subtracting corresponding entries. \((A-B)_{ij} = a_{ij} - b_{ij}\). Matrices of different sizes cannot be added or subtracted.
Interactive Example: Matrix Operations
Let’s demonstrate matrix addition and subtraction with Python:
Scalar Multiplication
If \(A\) is any matrix and \(c\) is any scalar (real number), then the product \(cA\) is the matrix obtained by multiplying each entry of \(A\) by \(c\). \(cA\) is called a scalar multiple of \(A\).
In matrix notation: \((cA)_{ij} = c(A)_{ij} = ca_{ij}\).
It is common practice to denote \((-1)B\) by \(-B\).
Application in ECE: Scaling measurements from sensors, adjusting signal amplitudes, or weighting different components in a multi-input system.
Matrix Multiplication (Product)
This is the most complex, but most powerful, basic matrix operation.
If \(A\) is an \(m \times r\) matrix and \(B\) is an \(r \times n\) matrix, then the product \(AB\) is the \(m \times n\) matrix.
Crucial Compatibility Rule: The number of columns of the first matrix (\(A\)’s columns, \(r\)) must equal the number of rows of the second matrix (\(B\)’s rows, \(r\)).
If compatible (\(m \times \mathbf{r} \cdot \mathbf{r} \times n\)), the resulting product matrix has size \(m \times n\).
Row-Column Rule: To find the entry \((AB)_{ij}\) (row \(i\), column \(j\) of \(AB\)), you single out row \(i\) from \(A\) and column \(j\) from \(B\). Multiply corresponding entries from the selected row and column, and then add up the resulting products. \[
(AB)_{ij} = a_{i1}b_{1j} + a_{i2}b_{2j} + \dots + a_{ir}b_{rj}
\]
Example 5: Multiplying Matrices
Find \(AB\) for: \[
A={\left[\begin{array}{l l l}{1}&{2}&{4}\\ {2}&{6}&{0}\end{array}\right]},\quad B={\left[\begin{array}{l l l l}{4}&{1}&{4}&{3}\\ {0}&{-1}&{3}&{1}\\ {2}&{7}&{5}&{2}\end{array}\right]}
\]\(A\) is \(2 \times \mathbf{3}\) and \(B\) is \(\mathbf{3} \times 4\). Product \(AB\) will be \(2 \times 4\).
Digital Signal Processing (DSP): Filtering operations, Fourier transforms can be expressed as matrix multiplications.
Interactive Example: Matrix Multiplication
Let’s use Python to compute the full matrix product:
Matrix Multiplication by Columns and By Rows
Matrix multiplication can be viewed column by column or row by row:
If \(AB\) is defined,
\(j\)-th column of \(AB\) is \(A\) times the \(j\)-th column of \(B\). \[
AB = A[\mathbf{b}_1\quad \mathbf{b}_2\quad \dots \quad \mathbf{b}_n] = [A\mathbf{b}_1\quad A\mathbf{b}_2\quad \dots \quad A\mathbf{b}_n]
\]
\(i\)-th row of \(AB\) is \(i\)-th row of \(A\) times \(B\). \[
AB = \left[ \begin{array}{c}\mathbf{a}_1\\ \mathbf{a}_2\\ \vdots \\ \mathbf{a}_m \end{array} \right]B = \left[ \begin{array}{c}\mathbf{a}_1B\\ \mathbf{a}_2B\\ \vdots \\ \mathbf{a}_mB \end{array} \right]
\]
This is useful for computing specific rows or columns without the full product.
Matrix Products as Linear Combinations
A linear combination of matrices \(A_1, \ldots, A_r\) with scalars \(c_1, \ldots, c_r\) is \(c_1A_1 + c_2A_2 + \dots + c_rA_r\).
Theorem 1.3.1: If \(A\) is an \(m \times n\) matrix and \(\mathbf{x}\) is an \(n \times 1\) column vector, then the product \(A\mathbf{x}\) can be expressed as a linear combination of the column vectors of \(A\), in which the coefficients are the entries of \(\mathbf{x}\).
\(A\mathbf{x} = x_1(\text{col }_1 \text{ of } A) + x_2(\text{col }_2 \text{ of } A) + \dots + x_n(\text{col }_n \text{ of } A)\)
Example 8:\[
{\left[\begin{array}{l l l}{-1}&{3}&{2}\\ {1}&{2}&{-3}\\ {2}&{1}&{-2}\end{array}\right]}{\left[\begin{array}{l}{2}\\ {-1}\\ {3}\end{array}\right]}={\left[\begin{array}{l}{1}\\ {-9}\\ {-3}\end{array}\right]}
\] This is equivalent to: \[
2{\left[\begin{array}{l}{-1}\\ {1}\\ {2}\end{array}\right]} - 1{\left[\begin{array}{l}{3}\\ {2}\\ {1}\end{array}\right]} + 3{\left[\begin{array}{l}{2}\\ {-3}\\ {-2}\end{array}\right]} = {\left[\begin{array}{l}{1}\\ {-9}\\ {-3}\end{array}\right]}
\]
Application in ECE: This is fundamental for understanding superposition principles in circuits, representing signals as combinations of basis functions (like Fourier series), or combining effects of multiple inputs in control systems.
Matrix Form of a Linear System
Any system of \(m\) linear equations in \(n\) unknowns can be written compactly as a single matrix equation: \[
A\mathbf{x} = \mathbf{b}
\] Where:
\(A\) is the coefficient matrix (\(m \times n\)).
\(\mathbf{x}\) is the unknown vector (\(n \times 1\)).
\(\mathbf{b}\) is the constant vector (\(m \times 1\)).
The augmented matrix for the system is \([A \mid \mathbf{b}]\).
Application in ECE: This compact notation simplifies the representation and analysis of large, complex systems found in circuits, control, and power systems. Rather than writing out pages of individual equations, we can deal with the entire system as one matrix equation.
Transpose of a Matrix
The transpose of an \(m \times n\) matrix \(A\), denoted by \(A^T\), is the \(n \times m\) matrix obtained by interchanging the rows and columns of \(A\).
The first column of \(A^T\) is the first row of \(A\), and so on.
The entry in row \(i\), column \(j\) of \(A^T\) is \((A^T)_{ij} = (A)_{ji}\).
Example: \[
A=\left[\begin{array}{c c c}{{1}}&{{-2}}&{{4}}\\ {{3}}&{{7}}&{{0}}\\ {{-5}}&{{8}}&{{6}}\end{array}\right] \quad \rightarrow \quad A^{T}=\left[\begin{array}{c c c}{{1}}&{{3}}&{{-5}}\\ {{-2}}&{{7}}&{{8}}\\ {{4}}&{{0}}&{{6}}\end{array}\right]
\] For a square matrix, this is like “reflecting” the matrix entries about its main diagonal.
Application in ECE:
Signal Processing: Analyzing properties of signals and systems, e.g., in covariance matrices for noisy signals.
Data Science/ML: Reshaping data for algorithms, in least squares regression and principal component analysis (PCA).
Quantum Mechanics: Representing operators and states in quantum computing.
Transpose of a Matrix
Trace of a Matrix
If \(A\) is a square matrix, then the trace of \(A\), denoted by \(\operatorname{tr}(A)\), is defined to be the sum of the entries on the main diagonal of \(A\). The trace of \(A\) is undefined if \(A\) is not a square matrix.
Scalar Multiplication: Scales all entries by a constant.
Matrix Multiplication: Row-column rule (inner dimensions must match) — represents linear transformations and data interaction.
Conceptual Depth: Matrix products as linear combinations (superposition, basis vectors).
Special Operations:
Transpose (\(A^T\)): Swaps rows and columns (data reorientation).
Trace (\(\operatorname{tr}(A)\)): Sum of main diagonal elements (for square matrices, revealing system properties).
Ubiquitous in ECE: These operations form the bedrock of numerical methods for solving problems in circuits, signals, control, robotics, imaging, communication, and machine learning.
Mastering these matrix operations is essential for your engineering toolkit!