Here you can find the source of computeMean(double[] data)
Parameter | Description |
---|---|
data | a parameter |
public static double computeMean(double[] data)
//package com.java2s; //License from project: Apache License public class Main { /**// w w w .j a v a2 s.c o m * Compute mean value of an array of double * * @param data * @return mean */ public static double computeMean(double[] data) { // sum of all the elements double sum = 0; for (double aData : data) { sum += aData; } return sum / data.length; } }