# How can I find all possible square submatrices of a given non-square matrix?

Lets say the non-square matrix is $n \times r$ where $n > r$ (# of rows is greater than # of columns). I'd like to find all $r \times r$ submatrices. What is really required is that I have to find and have all square submatrices simultaneously in order to compare their determinants at the same time. Here is the $6 \times 4$ matrix that I have. I need to find all fifteen $4 \times 4$ submatrices.

\begin{array}{cccc} 0 & -\text{Sin}\left[\theta _C\right] l_G & -\text{Sin}\left[\theta _D\right] l_C & 0 \\ 0 & \text{Cos}\left[\theta _C\right] l_G & \text{Cos}\left[\theta _D\right] l_C & 0 \\ -\text{Sin}\left[\theta _B\right] l_C & 0 & \text{Sin}\left[\theta _D\right] l_C & 0 \\ \text{Cos}\left[\theta _B\right] l_C & 0 & -\text{Cos}\left[\theta _D\right] l_C & 0 \\ 0 & \text{Sin}\left[\theta _C\right] l_G & \text{Sin}\left[\theta _D\right] l_C & -\text{Sin}\left[\theta _F\right] l_G \\ 0 & -\text{Cos}\left[\theta _C\right] l_G & -\text{Cos}\left[\theta _D\right] l_C & \text{Cos}\left[\theta _F\right] l_G \\ \end{array}

• Please include a Mathematica-formatted version of your matrix. You are less likely to get an answer if the answerer needs to re-type everything Aug 14 '16 at 23:46
• Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! Aug 15 '16 at 0:28

Subsets[mat, {4}]

Replace mat with your matrix.
subMatrices[mat_List] := Subsets[mat, Dimensions[mat][[{2}]]]