% submat - extract square submatrix
%
% submat :: [[N,M]], [[L]->[min(N,M)]] -> [[L,L]].
%
% submat(X,I)=X(I,I)
function B=submat(A,I), B=A(I,I); end
