There appear to be some good answers already, but here is a simple explanation of what you can do:
Suppose you want to know the rank of every i
-j
th submatrix of a matrix M
.
Now i believe the simplest way to get all ranks is to loop over all rows and columns and store this result in a matrix R
.
M = magic(5);
R = NaN(size(M));
for i=1:size(M,1);
for j=1:size(M,2);
R(i,j) = rank(M([1:i-1 i+1:end],[1:j-1 j+1:end]));
end
end
If you want all determinants replace rank
with det
.