Delete matrix columns
MuPAD® notebooks are not recommended. Use MATLAB® live scripts instead.
MATLAB live scripts support most MuPAD functionality, though there are some differences. For more information, see Convert MuPAD Notebooks to MATLAB Live Scripts.
linalg::delCol(A
,c
) linalg::delCol(A
,c_{1} .. c_{2}
) linalg::delCol(A
,list
)
linalg::delCol(A, c)
returns a copy of the
matrix A in
which the column with index c is
deleted.
linalg::delCol(A, c_{1}.. c_{2})
deletes
those columns whose indices are in the range c_{1}..
c_{2}
. If c_{2}<
c_{1}
then the input matrix A
is
returned.
linalg::delCol(A, list)
deletes those columns
whose indices are contained in list
.
If all columns are deleted then NIL
is returned.
We define the following matrix:
A := matrix([[1, 2, 3, 4], [5, 6, 7, 8]])
and demonstrate the three different input formats for linalg::delCol
:
linalg::delCol(A, 2)
linalg::delCol(A, [1, 3])
linalg::delCol(A, 2..4)
We compute the inverse of the 2×2 matrix:
MatQ := Dom::Matrix(Dom::Rational): A := MatQ([[3, 2], [5, 4]])
by appending the 2×2 identity
matrix to the right side of A and
applying the GaussJordan algorithm provided by the function linalg::gaussJordan
:
B := linalg::gaussJordan(A . MatQ::identity(2))
We get the inverse of A
by deleting the first
two columns of the matrix B
:
AI := linalg::delCol(B, 1..2)
Finally, we check the result:
A * AI, AI * A
Note: The inverse of A
can be computed directly
by entering 1/A
.

An m×n matrix
of a domain of category 

The column index: a positive integer less or equal to n 

A range of column indices (positive integers less or equal to n) 

A list of column indices (positive integers less or equal to n) 
Matrix of a domain of category Cat::Matrix(R)
,
where R
is the component ring of A
,
or NIL
.