Series
(Series)
Create new time series object
Syntax
X = Series()
X = Series(dates, values)
X = Series(dates, values, comments)
X = Series(dates, values, comments, userData)
Input Arguments
dates
[ numeric | char ]
Dates for which observations will be supplied;
dates
do not need to be sorted in ascending order or create a continuous date range. Ifdates
is scalar andvalues
have multiple rows, then the date is interpreted as the start date for the entire time series.
values
[ numeric | function_handle ]
Numerical values (observations) arranged columnwise, or a function that will be used to create an N-by-1 array of values, where N is the number of
dates
.
comments
[ string ]
Comment(s) attached to each column of the time series; if omitted, comments will be empty strings.
userData
[ * ]
Any kind of user data attached to the object; if omitted, user data will be empty; if
userData
is a struct, the Series methodsaccessUserData
andassignUserData
can be used access or assign/change them.
Output Arguments
x
[ Series ]
New times series.
Description
Example
x = Series(qq(2020,1):qq(2021,4), rand(8, 1), "Random numbers");
x = Series(qq(2020,1), rand(8, 1), "Random numbers");
x = Series(qq(2020,1):qq(2021,4), @rand, "Random numbers");