Language Reference


STD Function

STD (x);

The STD function computes a sample standard deviation of data. The sample standard deviation of a column vector is computed as the square root of the sample variance. See the VAR function for details.

When x is a matrix, the sample variance is computed for each column, as the following example shows:

x = {5 1 10,
     6 2 3,
     6 8 .,
     6 7 9,
     7 2 13};

std = std(x);
print std;

Figure 24.397: Standard Deviation of Columns

std
0.7071068 3.2403703 4.1932485



The STD function returns a missing value for columns with fewer than two nonmissing observations.