code: public static void writeText(String featuresFileName, double[][] features) throws Exception {
  		BufferedWriter out = new BufferedWriter(new FileWriter(featuresFileName));
  		for (double[] feature : features) {
  			for (int j = 0; j < feature.length - 1; j++) {
  				out.write(feature[j] + ",");
  			}
  			out.write(feature[feature.length - 1] + "\n");
  		}
  		out.close();
  	}
docs: Takes a two-dimensional double array with features and writes them in a comma separated text file.
  
  @param featuresFileName
  The text file's name.
  @param features
  The features.
  @throws Exception