in a non-full rank matrix, how to find the dependent rows especifically in MATLAB?

1.1k Views Asked by At

I have a very large matrix, which its determinant is zero, and hence it is not full rank. Now I wonder is there a way to find which rows are linearly dependent? specifically in MatLab is there any command which outputs the desired result?

1

There are 1 best solutions below

0
On BEST ANSWER

Finding elements of the kernel of the matrix is equivalent to finding non-trivial linear combinations of the rows of the matrix:

If $A= (\vec a_1 , \vec a_2, \dots, \vec a_n)$ and $\vec a_i$s are row vectors, then for $\vec x=\begin{pmatrix} x_1\\x_2\\ \vdots\\x_n \end{pmatrix}$ we have $$A\vec x = 0 \mbox{ iff } \sum_{i=1}^n x_i \vec a_i = 0 .$$

These $\vec x$ can be done by computing the eigenvectors for the eigenvalue $0$.

If you're interested in linear combinations of the columns of $A$, you need to compute the kernel of $A^T$.

Edit: Since the question specifically asked for MATLAB commands, here's what I found in the matlab documentation regarding finding the kernel (also called null space), namely the command null(A):

Z = null(A) is an orthonormal basis for the null space of A obtained from the singular value decomposition. That is, $A*Z$ has negligible elements, size(Z,2) is the nullity of $A$, and $Z'*Z = I$.

Z = null(A,'r') is a "rational" basis for the null space obtained from the reduced row echelon form. $A*Z$ is zero, size(Z,2) is an estimate for the nullity of $A$, and, if $A$ is a small matrix with integer elements, the elements of the reduced row echelon form (as computed using rref) are ratios of small integers.

The orthonormal basis is preferable numerically, while the rational basis may be preferable pedagogically.