For matrix related problems like subset selection and other reformatting issues, i strongly recommend you go for Scilab or R computational platforms, instead of C.
The best analytic, computational & visualization for Vectors and Matrix Analysis is MATLAB. It is just very easy through MATLAB. Please try MATLAB, which is best and easy computing tool for all sciences...