redΒΆ
- Purpose:
Reduce the size of a square matrix by omitting rows and columns.
- Syntax:
B = red(A, b)
[B, b] = red(A, b)
- Description:
B = red(A, b)reduces the square matrixAto a smaller matrixBby omitting rows and columns ofA. The indices for rows and columns to be omitted are specified by the column vectorb.- Example:
Assume that the matrix
Ais defined asA\(= \begin{bmatrix} 1 & 2 & 3 & 4 \\ 5 & 6 & 7 & 8 \\ 9 & 10 & 11 & 12 \\ 13 & 14 & 15 & 16 \end{bmatrix}\)and
basb\(= \begin{bmatrix} 2 \\ 4 \end{bmatrix}\)The statement
B = red(A, b)results in the matrixB\(= \begin{bmatrix} 1 & 3 \\ 9 & 11 \end{bmatrix}\)