Computes the average value of a subset of an array. @param array the data to be averaged @param start the index of the first point to be averaged @param num the total number of points to be averaged @return
(double[] array, int start, int num)
| 196 | * @return |
| 197 | */ |
| 198 | public static double computeAverage(double[] array, int start, int num) { |
| 199 | double sum = 0; |
| 200 | for(int i = start, stop = start+num; i<stop; i++) { |
| 201 | sum += array[i]; |
| 202 | } |
| 203 | return sum/num; |
| 204 | } |
| 205 | |
| 206 | /** |
| 207 | * Creates a function having a constant value. |
no outgoing calls
no test coverage detected