Skip to main content
Engineering LibreTexts

14.2: Editing Matrices

  • Page ID
    15000
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    There are many different ways to alter an existing matrix. In these examples, note that we don’t use the variable c since that is the built-in variable for the speed of light (although we could redefine c, there is no need to do so and it is generally a good idea not to overwrite the built-in variables).

    • Augmenting a matrix by another matrix (side-by-side)

    If two matrices have the same number of rows, we can create a new matrix with the command augment:

    clipboard_ef55a59e934b09a40494454fa25fc4592.png

    • Stacking two matrices

    If two matrices have the same number of columns, we can create a new matrix with the command stack:

    clipboard_e0ff76f2f55c44cadad93cfe9f178b6a1.png

    • Inserting a row or column

    To insert new row(s) or column(s) to an existing matrix, select an entry of the matrix. The inserted row(s) or column(s) will appear below or to the right of the selected entry. Then click the clipboard_e1c4b2b3bad759f4f7a663ad2c5a0fb62.png button. Change the entries for the desired number of rows and columns and click “Insert”. If you only want to insert a single row, set the number of columns to zero. If you only want to insert a single column, set the number of rows to zero.

    New rows are inserted below a highlighted row and columns are inserted to the right of a highlighted row. If you want to insert a new first row or column, you need to select the whole matrix before using the clipboard_e79a4af084faa7f34a17f0ffceb0b6341.png button and making the insertion.

    • Deleting a row or column

    ​​​​​​​The process of deleting rows or columns is similar to making insertions. To delete rows or columns from an existing matrix, select an entry of the matrix. The deleted rows or columns will contain that entry and delete rows below and columns to the right. Then click the clipboard_e79a4af084faa7f34a17f0ffceb0b6341.png​​​​​​​ button. Change the entries for the desired number of rows and columns and click “Delete”.


    This page titled 14.2: Editing Matrices is shared under a CC BY-NC 3.0 license and was authored, remixed, and/or curated by Troy Siemers (APEX Calculus) via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.