Main Content

max

Maximum oftimeseriesdata

Description

example

tsmax = max(ts)returns the maximum value of the data samples in atimeseriesobject.

tsmax = max(ts,Name,Value)specifies additional options when computing the maximum using one or more name-value pair arguments. For example,tsmax = max(ts,'Quality',-99,'MissingData','remove')defines -99 as the missing sample quality code, and removes the missing samples before computing the maximum.

Examples

collapse all

创建一个timeseriesobject and compute the maximum data sample.

ts = timeseries((1:5)'); tsmax = max(ts)
tsmax = 5

Input Arguments

collapse all

Inputtimeseries, specified as a scalar.

Data Types:timeseries

Name-Value Arguments

Specify optional pairs of arguments asName1=Value1,...,NameN=ValueN, whereNameis the argument name andValueis the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and encloseNamein quotes.

Example:tsmax = max(ts,'Quality',-99,'MissingData','remove')

Missing value indicator, specified a scalar, vector, matrix, or multidimensional array of integers ranging from -128 to 127. Each element is a quality code to treat as missing data.

By default,maxremoves any missing data before computing the maximum. To interpolate the data instead of removing it, specify the name-value pair'MissingData','interpolation'.

Data Types:single|double|int8|int16|int32|int64|uint8|uint16|uint32|uint64

Missing data method, specified as either'remove'to remove missing values before computing the maximum or“插入”to fill missing values by interpolating the data. Specify the'Quality'name-value pair to indicate which data samples are considered missing.

Version History

Introduced before R2006a

See Also

||