I have a $\boldsymbol{M}_{6\times 6}$ matrix structured as follows:
$$\boldsymbol{A} = \begin{bmatrix}a_1 & a_2 & a_3 & 0 & 0 & 0\\0 & a_1 & 0 & a_2 & a_3 & 0\\0 & 0 & a_1 & 0 & a_2 & a_3\end{bmatrix}$$
$$\boldsymbol{B} = \begin{bmatrix}b_1 & b_2 & b_3 & 0 & 0 & 0\\0 & b_1 & 0 & b_2 & b_3 & 0\\0 & 0 & b_1 & 0 & b_2 & b_3\end{bmatrix}$$
$$\boldsymbol{M} = \begin{bmatrix}\boldsymbol{A}\\\boldsymbol{B}\end{bmatrix} = \begin{bmatrix}a_1 & a_2 & a_3 & 0 & 0 & 0\\0 & a_1 & 0 & a_2 & a_3 & 0\\0 & 0 & a_1 & 0 & a_2 & a_3\\b_1 & b_2 & b_3 & 0 & 0 & 0\\0 & b_1 & 0 & b_2 & b_3 & 0\\0 & 0 & b_1 & 0 & b_2 & b_3\end{bmatrix}$$
I populated $\boldsymbol{A}$, $\boldsymbol{B}$ with several different combinations of values for $a_i, b_i$, e.g., $a_i$ = $[1, 2, 3]$, $b_i$ = $[4, 5, 6]$, to find the rank of $\boldsymbol{M}$ using MATLAB.
It turns out that $Rank(\boldsymbol{A})=3$ and $Rank(\boldsymbol{B})=3$, but, $\boldsymbol{M}$ is rank-deficient with $Rank(\boldsymbol{M})=5$. I was not able to find the dependent row in $\boldsymbol{M}$. All rows look like linearly independent.
I tried to find the rank of M([r1, r2, r3, r4, r5],:) but no matter what combination of 5 rows I pick, the rank is 5 which implies that any 5 rows combinations are linearly independent. Does this mean the 6th row is a combination of other 5 rows?
Could someone kindly help me how I can find the row in $\boldsymbol{M}$ that is linearly dependent and makes $\boldsymbol{M}$ rank deficient?
Not quite. It means that there are linear combination of the six rows (or the six columns) that sum to zero. Therefore, any one of the rows (or columns) can be expressed as a linear combination of the other 5 rows (or 5 columns).
As stated above, any one of the columns can be expressed as a nontrivial linear combination of the other 5 columns. ("Nontrivial" i.e. the coefficients of the linear combination are not all zero.) I will show how to find such a linear combination.
The reduced row echelon form $M$ is
$$ \textrm{rref}(M) = \left[ \begin {array}{cccccc} 1&0&0&0&0&-{\dfrac { \left( {a_2}{ b_3}-{a_3}{b_2} \right) ^{2}}{ \left( {b_2}{a_1}-{ b_1}{a_2} \right) ^{2}}}\\ 0&1&0&0&0&{\dfrac { \left( {b_3}{a_1}-{b_1}{a_3} \right) \left( {a_2 }{b_3}-{a_3}{b_2} \right) }{ \left( {b_2}{a_1}-{ b_1}{a_2} \right) ^{2}}}\\ 0&0&1&0&0&-{ \dfrac {{a_2}{b_3}-{a_3}{b_2}}{{b_2}{a_1}-{ b_1}{a_2}}}\\ 0&0&0&1&0&-{\dfrac { \left( {b_3 }{a_1}-{b_1}{a_3} \right) ^{2}}{ \left( {b_2}{a_1 }-{b_1}{a_2} \right) ^{2}}}\\ 0&0&0&0&1&{ \dfrac {{b_3}{a_1}-{b_1}{a_3}}{{b_2}{a_1}-{ b_1}{a_2}}}\\ 0&0&0&0&0&0\end {array} \right] $$
(I computed this using the
Maplesoftware.) The fact that the last row is all zero implies that the $M$ is rank-deficient.Moreover, the $\textrm{rref}(M)$ implies that
$$ \vec{x} = \left[ \begin {array}{c} {\dfrac { \left( {a_2}{b_3}-{a_3} {b_2} \right) ^{2}s}{ \left( {b_2}{a_1}-{b_1}{a_2 } \right) ^{2}}}\\ -{\dfrac { \left( {b_3}{ a_1}-{b_1}{a_3} \right) \left( {a_2}{b_3}-{a_3}{ b_2} \right) s}{ \left( {b_2}{a_1}-{b_1}{a_2} \right) ^{2}}}\\ {\dfrac { \left( {a_2}{b_3} -{a_3}{b_2} \right) s}{{b_2}{a_1}-{b_1}{a_2}}} \\ {\dfrac { \left( {b_3}{a_1}-{b_1}{ a_3} \right) ^{2}s}{ \left( {b_2}{a_1}-{b_1}{a_2} \right) ^{2}}}\\ -{\dfrac { \left( {b_3}{a_1 }-{b_1}{a_3} \right) s}{{b_2}{a_1}-{b_1}{a_2}} }\\ s\end {array} \right] $$
spans the null space of $M$: in other words, for any real number $s$, $$ M \vec{x} = \vec{0}. \tag{*} $$
Equation (*) is equivalent with the following equation
$$ \sum_{n=1}^6 x_n\vec{M}_n = 0, \tag{$\dagger$} $$
where "$\vec{M}_n$" denotes the $n$th column of the matrix $M$. Since $x_n$ is a function of $s$, simply substitute one nonzero value of $s$. Then, Equation ($\dagger$) indicates a nontrivial linear combination of the column vectors of $M$ that sums to zero.