timeseries

Methods

Method Reference: timeseries.append

timeseries: ts = append (ts1, ts2, …)

Join series end to end in time.

ts = append (ts1, ts2, …) returns one series holding the samples of every argument in turn. An argument may be an array of series, taken element by element, and series with no samples are skipped. Each series must start at or after the end of the one before, so equal times where two meet give a repeated time; a gap is kept. Their samples must be of one size; the class of the data follows concatenation.

Series with a TimeInfo.StartDate and series without one cannot be mixed. Times are converted to the coarsest units among them, and dates are counted from the first series’ start date.

Quality codes are joined when every series has them and refused when only some do; MATLAB then keeps too few codes or drops them. The result takes its name, DataInfo.Units and QualityInfo from the series when they all agree, and otherwise 'unnamed', '' and none; MATLAB always names it 'unnamed' and drops QualityInfo. Events are gathered from every series, and every other property is the first series’.

See also: timeseries.addsample

Source Code: timeseries

append joins series end to end. Each must start at or after the end of the one before; where two meet at a time, that time repeats.

 a = timeseries ([1; 2; 3], [0; 1; 2]);
 b = timeseries ([4; 5], [2; 3]);
 ts = append (a, b);
 [ts.Time, ts.Data]
ans =

   0   1
   1   2
   2   3
   2   4
   3   5

Times in different units are converted to the coarser.

 a = timeseries ([1; 2], [0; 30]);
 b = timeseries ([3; 4], [1; 2]);
 b.TimeInfo.Units = 'minutes';
 ts = append (a, b);
 ts.TimeInfo.Units
ans = minutes
 [ts.Time, ts.Data]
ans =

        0   1.0000
   0.5000   2.0000
   1.0000   3.0000
   2.0000   4.0000