CalcSD.c



void CalcSD(REAL val, int action, REAL *mean, REAL *SD)

Description

Calculate the mean and standard deviation from a set of numbers. The routine is called with each value to be sampled and the action required is specified:

Inputs

val int The value to be sampled
action short 0: Sample the value 1: Calculate & return mean and SD 2: Clear the sample lists

Outputs

mean *REAL The returned mean
SD *REAL The returned standard deviation

The output values are only set when action=1

Created: 30.03.90 Last Modified: 22.06.94