Documentation Center

  • Trials
  • Product Updates


Class: timeseries

Standard deviation of timeseries data


ts_std = std(ts)
ts_std = std(ts,Name,Value)


ts_std = std(ts) returns the standard deviation of the timeseries data.

ts_std = std(ts,Name,Value) specifies additional options specified with one or more Name,Value pair arguments.

Input Arguments


The timeseries object for which you want the standard deviation of the data.

Name-Value Pair Arguments




Default: remove





Output Arguments


The standard deviation of ts.Data values as follows:

  • When ts.Data is a vector, ts_std is the standard deviation of ts.Data values.

  • When ts.Data is a matrix, and IsTimeFirst is true, and the first dimension of ts is aligned with time, then ts_std is the standard deviation of each column of ts.Data.

When ts.Data is an N-dimensional array, std always operates along the first nonsingleton dimension of ts.Data.


The following example finds the standard deviation for a timeseries object. MATLAB® calculates the standard deviation for each data column in the timeseries object.

% Load a 24-by-3 data array:

load count.dat

% Create a timeseries object with 24 time values:

count_ts = timeseries(count,1:24,'Name','CountPerSecond');

% Calculate the standard deviation of each data column for this 
% timeseries object:


MATLAB returns:

25.3703   41.4057   68.0281


MATLAB determines weighting by:




    • Last time point — The duration of the last time interval ((t(end) - t(end - 1)).




See Also

| | | | | | |

Was this topic helpful?