tscollection.settimeseriesnames
tscollection: tc = settimeseriesnames (tc, old, new)
Rename a member.
tc = settimeseriesnames (tc, old, new)
renames the member old, its exact name, to new, a valid
variable name, both character vectors or string scalars; the series
takes the new name too, and the member becomes the last, as in
MATLAB. new must not be the name of another member, ignoring
case, nor of one of the four properties.
MATLAB accepts the name of another member and drops that member, and accepts a name differing from another only in case, after which that member cannot be reached; both are refused here.
See also: tscollection.gettimeseriesnames, tscollection.addts
Source Code: tscollection
Renaming a member renames its series too, and makes it the last member, as in MATLAB.
tc = tscollection ({timeseries([1; 2], [0; 1], 'Name', 'a'), ...
timeseries([3; 4], [0; 1], 'Name', 'b')});
tc = settimeseriesnames (tc, 'a', 'alpha');
gettimeseriesnames (tc)
ans =
1x2 cell array
{'b'} {'alpha'}
tc.alpha.Name
ans = alpha