Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

mean (timeseries) - Mean value of timeseries data

Syntax

ts_mn = mean(ts)
ts_mn = mean(ts,'PropertyName1',PropertyValue1,...)

Description

ts_mn = mean(ts) returns the mean value of ts.Data. When ts.Data is a vector, ts_mn is the mean value of ts.Data values. When ts.Data is a matrix, ts_mn is a row vector containing the mean value of each column of ts.Data (when IsTimeFirst is true and the first dimension of ts is aligned with time). For the N-dimensional ts.Data array, mean always operates along the first nonsingleton dimension of ts.Data.

ts_mn = mean(ts,'PropertyName1',PropertyValue1,...) specifies the following optional input arguments:

Examples

The following example illustrates how to find the mean values in multivariate time-series data.

  1. Load a 24-by-3 data array.

    load count.dat
    
  2. Create a timeseries object with 24 time values.

    count_ts = timeseries(count,[1:24],'Name','CountPerSecond')
    
  3. Find the mean of each data column for this timeseries object.

    mean(count_ts)
    
    ans =
    
       32.0000   46.5417   65.5833
    

The mean is found independently for each data column in the timeseries object.

See Also

iqr (timeseries), max (timeseries), min (timeseries), median (timeseries), std (timeseries), timeseries, var (timeseries)

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS