NewStats:

Path: Math/Analysis

% Calculates the new standard deviation and average.

--------------------------------------------------------------------------
   Form:
   [s, m]  = NewStats( oldS, oldM, count, x )
--------------------------------------------------------------------------

    ------
    Inputs
    ------

    oldS      (:,:)  Old standard deviation of the data set
    oldM      (:,:)  Old average of the data set
    count     (1,1)  Number of elements in data set (including x)
    x         (:,:)  New element that has been added to the data

    -------
    Outputs
    -------

    s         (:,:)  New standard deviation
    m         (:,:)  New average

--------------------------------------------------------------------------

Back to the Math Module page