Calculates the mean (first moment) of array elements. Analog of the mean() in R.
[in] Array with data for calculation of the mean.
[in] Initial index for calculation.
[in] The number of elements for calculation.
The mean of array elements. In case of error it returns NaN (not a number).