tsout = addsample(tsin,'Data',datavals,'Time',timevals)
adds one or more data samples to a timeseries object
tsin using an array of data datavals and a
corresponding time vector timevals.
tsout = addsample(tsin,'Data',datavals,'Time',timevals,Name,Value)specifies
additional information for adding data samples using one or more name-value
pairs.
tsout = addsample(tsin,s)
adds data whose information is contained in the structure
s.
Sample times, specified as a numeric scalar or vector, or a cell array of
date character vectors. Valid date character vectors and strings can have
the following forms:
Sample structure, specified as a scalar of type struct
with the following optional fields:
s.data — Numeric array of data
s.time — Numeric time vector or cell array of
valid date character vectors or strings
s.quality — Integer array of quality codes from
-128 to 127
s.overwriteflag — Overwrite indicator specified
as true to overwrite existing data samples with
the added samples
Data Types: struct
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 quotes. You can specify several name and value
pair arguments in any order as
Name1,Value1,...,NameN,ValueN.
Quality codes, specified as [] or a scalar, vector,
or multidimensional array of integers ranging from -128 to 127.
When the quality code value is a vector, it must have the
same length as the time vector. Each element applies to the
corresponding data sample.
When the quality code value is an array, it must have the
same size as the data array. Each element applies to the
corresponding element of the data array.
Overwrite indicator, specified as a logical value that controls
whether to overwrite data samples that have the same associated time as
the added samples. true indicates the added data
overwrites the previous data, while false adds the
sample resulting in a repeated time value.