| Contents | Index |
Mean value of timeseries data
ts_mn = mean(ts)
ts_mn = mean(ts,Name,Value)
ts_mn = mean(ts) returns the mean value of ts.Data.
ts_mn = mean(ts,Name,Value) returns the mean value of ts.Data with additional options specified by one or more Name,Value pair arguments.
ts |
The timeseries object for which you want the mean value of data. |
Specify optional comma-separated pairs of Name,Value arguments, where Name is the argument name and Value is the corresponding value. Name must appear inside single quotes (' '). You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.
Find the mean values in multivariate time-series data:
% 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') % Find the mean of each data column for this timeseries object: mean(count_ts)
MATLAB returns:
32.0000 46.5417 65.5833
MATLAB determines weighting by:
Attaching a weighting to each time value, depending on its order, as follows:
First time point — The duration of the first time interval (t(2) - t(1)).
Time point that is neither the first nor last time point — The duration between the midpoint of the previous time interval to the midpoint of the subsequent time interval ((t(k + 1) - t(k))/2 + (t(k) - t(k - 1))/2).
Last time point — The duration of the last time interval ((t(end) - t(end - 1)).
Normalizing the weighting for each time by dividing each weighting by the mean of all weightings.
Multiplying the data for each time by its normalized weighting.
timeseries | timeseries.iqr | timeseries.max | timeseries.median | timeseries.min | timeseries.std | timeseries.sum | timeseries.var

Explore how to use MATLAB to make advancements in engineering and science.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |