median (timeseries) - Median value of timeseries data

Syntax

ts_med = median(ts)
ts_med = median(ts,'PropertyName1',PropertyValue1,...)

Description

ts_med = median(ts) returns the median value of ts.Data. When ts.Data is a vector, ts_med is the median value of ts.Data values. When ts.Data is a matrix, ts_med is a row vector containing the median 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, median always operates along the first nonsingleton dimension of ts.Data.

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

Examples

The following example illustrates how to find the median 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 median of each data column for this timeseries object.

    median(count_ts)
    
    ans =
    
       23.5000   36.0000   39.0000
    

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

See Also

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

  


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