Java examples for java.lang:Math Matrix
Compute the mean of a vector.
//package com.java2s; public class Main { /**/* w ww . ja v a 2 s. com*/ * Compute the mean of a vector. */ public static double getMean(double[] data) { double sum = 0.0; for (int i = 0; i < data.length; i++) { sum += data[i]; } return sum / (double) data.length; } }