Quantcast

Documentation Center

  • Trial Software
  • Product Updates

max

Class: timeseries

Maximum value of timeseries data

Syntax

ts_max = max(ts)
ts_max = max(ts,Name,Value)

Description

ts_max = max(ts) returns the maximum value in the timeseries data.

ts_max = max(ts,Name,Value) returns the maximum value in the timeseries data with additional options specified by one or more Name,Value pair arguments.

Input Arguments

ts

The timeseries object for which you want to determine the maximum data value.

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. 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.

'MissingData'

A string specifying one of two possible values, remove or interpolate, indicating how to treat missing data during the calculation.

Default: remove

'Quality'

A vector of integers, indicating which quality codes represent missing samples (for vector data) or missing observations (for data arrays with two or more dimensions).

Output Arguments

ts_max

The maximum data value in the specified timeseries object, as follows:

  • When ts.Data is a vector, ts_max is the maximum value of ts.Data values.

  • When ts.Data is a matrix, IsTimeFirst is true, and the first dimension of ts is aligned with time, then ts_max is a row vector containing the maximum value of each column of ts.Data.

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

Examples

The following example illustrates how to find the maximum 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 maximum in each data column for this timeseries object:

max(count_ts)

MATLAB® returns:

114   145   257

See Also

| | | | | | |

Was this topic helpful?