Android examples for java.lang:array calculation
mean value from two dimensional array
//package com.java2s; public class Main { public static double mean2(double[][] a) { double[] sum = new double[a.length]; for (int i = 0; i < sum.length; i++) { sum[i] = mean(a[i]);//from w ww . j ava 2 s . co m } return mean(sum); } public static double mean(double[] a) { double sum = 0; for (double i : a) { sum += i; } return sum / a.length; } }