Contents Previous Next Subchapters

Computing The Standard Deviation (Mlmode)
Syntax colstd(x)
See Also colstd , mlmode_mean , colmean

Description
If x is a row vector, returns a scalar equal to the standard deviation of the elements of x Otherwise returns a row vector, with the same number of columns as x, containing the standard deviation of each column of x where x is a real, double-precision, or complex matrix. If x is complex or integer, the return value is double-precision, otherwise the return value has the same type as x.

The standard deviation of an N element vector y is
             --------------------------------------
            /        _   2                    _   2
           / | y   - y  |   + ... +  | y    - y  |
     \    /     1                        N      
      \  /   -------------------------------------
       \/                     N - 1
where
     _       1
     y   =  --- ( y  + ... + y )
             N     1          N

Example
If in Mlmode you enter
     x = [0, 2, 4];
     std(x)
O-Matrix will respond
     2