code: public static double[] getCol(double[][] m1, int col) {
      double[] ret = new double[m1.length];
      for(int i = 0; i < ret.length; i++) {
        ret[i] = m1[i][col];
      }
      return ret;
    }
docs: Get a column from a matrix as vector.
  
  @param m1 Matrix to extract the column from
  @param col Column number
  @return Column