Here you can find the source of scale(double[][] as)
public static double[][] scale(double[][] as)
//package com.java2s; //License from project: GNU General Public License import java.util.Arrays; public class Main { public static double[][] scale(double[][] as) { final int VALUES = as[0].length; double[][] result = new double[as.length][VALUES]; for (int v = 0; v < VALUES; v++) { double max = as[as.length - 1][v]; for (int i = 0; i < as.length; i++) { result[i][v] = as[i][v] / max; }/*from w ww . j a v a 2 s. c o m*/ } System.out.println(Arrays.deepToString(result)); return result; } }