An ambiguous question, and possibly, an ambitious question too. For example, do you feel it to be of importance to test the submatrix A([2 3 5 7],:) for singularity? My guess is the wording of your question indicates that is indeed a valid 4x4 submatrix, that you actually want to test every possible combination of 4 rows of that matrix.
Using det to test for coplanarity is a really bad idea however, but who am I to say? Well, I honestly don't care, I'll say it anyway.
Anyway, I have a funny feeling that you CAN'T want to test EVERY possible 4x4 subarray of an array with 8267 rows. Why not?
So you might be asking to create and store the results of det on roughly 200 trillion subarrays.
So since each output of det is a double precision number, a few million gigabytes of RAM will be sufficient to store the results, if that is your intention. Those petabyte RAM chips are so expensive. Worse, every time I try to draw enough power to drive my petabyte ram chips, it makes all the wiring in my house melt down from the current load. Then the power company starts complaining, because they need to ramp up another nukular (I gotta get a speel chcker one day) power plant whenever I use my computer.
So, possibly Birdman is correct in the assessment that you MUST therefore have intended to take consecutive 4x4 blocks of the rows. I think you actually intended to ask the question as I interpret it however, and you just underestimate the computational requirements of your goal.
In the event that you really do want to generate and test all combinations of 4 rows of a more reasonably sized array, then you can list out the row combinations to test using nchoosek:
Then just use a loop. Other vectorized solutions are possible too.
Perhaps there is a simpler solution. For example, consider the array A:
A is a 12x4 array. If we take all subsets of the first 11 out of 12 of those rows...
There are 165 such subsets. Consider the subset of rows [2 3 5].
ind = [2 3 5];
So, as long as the rank of some combination of 3 rows is exactly 3, then that set of rows is viable to test. Now, call qr ONCE for that subset.
[~,R] = qr(A([ind,max(ind)+1:12],:)')
-1.8725 -0.15746 -0.83202 -1.8725 -0.15746 -1.2218 -0.83202 -1.8725 -0.15746 -1.2218
0 0.10811 0.14309 0 0.10811 0.049941 0.14309 0 0.10811 0.049941
0 0 0.55577 0 0 -0.33634 0.55577 0 0 -0.33634
0 0 0 0 0 0.17258 -5.5511e-17 0 0 0.17258
Ignore the first 3 columns of R, and the first three rows.
0 0 0.17258 -5.5511e-17 0 0 0.17258
The vector R(4,4:end) corresponds to appending rows 6:12 to the inital set based on ind. So
will effectively append all the rows below max(ind) to the set in question.
See that only the third and 7'th cases in that vector ended up as non-zero, since the number -5.5511e-17 is just floating point trash. That means that if we want to find all sets of rows that start with [2 3 5], then ONLY the subsets of rows [2 3 5 8] and [2 3 5 12] form linearly independent sets. Thus, the submatrices composed of rows [2 3 5], combined with any of the rows [6 7 9 10 11] are ALL linearly dependent. This claim is trivially verified of course, based on the way I created A in the first place.
Effectively, this allows you to test EVERY subset of 4 rows using only 165 calls to QR, instead of 495 calls to det.
More importantly, the calls to QR will be more numerically stable ways to test for linear independence, whereas det is a total piece of crap for that purpose. (I'll concede that a pivoted QR is more stable numerically than the unpivoted default QR.)
That will also mean you need only make
so only around 95 billion calls to QR, instead of 200 trillion calls to det. Clearly a vast improvement. Sigh.