[X,Incl,Range] = db2array(D)
[X,Incl,Range] = db2array(D,List)
[X,Incl,Range] = db2array(D,List,Range,...)
D
[ struct ] - Input database with tseries objects that will be converted to a numeric array.
List
[ char | cellstr ] - List of tseries names that will be converted to a numeric array; if not specified, all tseries entries found in the input database, D
, will be included in the output arrays, X
.
Range
[ numeric | Inf
] - Date range; Inf
means a range from the very first non-NaN observation to the very last non-NaN observation.
X
[ numeric ] - Numeric array with observations from individual tseries objects in columns.
Incl
[ cellstr ] - List of tseries names that have been actually found in the database.
Range
[ numeric ] - Date range actually used; this output argument is useful when the input argument Range
is missing or Inf
.
The output array, X
, is always NPer-by-NList-by-NAlt, where NPer is the length of the Range
(the number of periods), NList is the number of tseries included in the List
, and NAlt is the maximum number of columns that any of the tseries included in the List
have.
If all tseries data have the same size in 2nd and higher dimensions, the output array will respect that size in 3rd and higher dimensions. For instance, if all tseries data are NPer-by-2-by-5, the output array will be NPer-by-Nx-by-2-by-5. If some tseries data have unmatching size in 2nd or higher dimensions, the output array will be always a 3D array with all higher dimensions unfolded in 3rd dimension.
If some tseries data have smaller size in 2nd or higher dimensions than other tseries entries, the last available column will be repeated for the missing columns.