Problems adding time series object to a time series collection

1 view (last 30 days)
I have a time series collection with several objects. Inserting a new object using addts does not work. To try to isolate the error I have tried to extract a time series object from the collection
ts=tsc.(tsname); % works fine
Then I rename the time series object to a new name not being used by any other objects in the collection
ts.name='newts'; % works fine
The I try to add this object to the collection. The object is an exact copy of an object already member of the collection, but with a new unused name.
tsc=addts(tsc,ts); % this fails returning the following error messages
Error using vertcat Number of fields in structure arrays being concatenated do not match. Concatenation of structure arrays requires that these arrays have the same set of fields.
Error in tscollection/setts (line 155) this.Members_ = [this.Members_; x];
Error in tscollection/addts>localUpdateTS (line 187) h = setts(h,ts,ts.Name);
Error in tscollection/addts (line 123) h = localUpdateTS(h,ts,name);

Answers (0)

Categories

Find more on Time Series in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!