[X1,X2,...] = split(t,units)
returns the calendar duration values specified in t as separate
numeric arrays, one for each of the date or time units specified by
units. The number of date and time units specified by
units determines the number of output arguments.
t — Input calendar duration calendarDuration array
Input calendar duration, specified as a
calendarDuration array.
Data Types: calendarDuration
units — Date and time units character vector | cell array of character vectors | string array
Date and time units, specified as a character vector, a cell array of
character vectors, or a string array. Specify units
only when the first input argument is the
calendarDuration array,
t.
The units can be one or more of the values in the table.
Value
Units t Is Split
Into
'years'
years
'quarters'
quarters
'months'
months
'weeks'
weeks
'days'
days
'time'
time, in the format hours:minutes:seconds
You must specify date and time units from largest to
smallest. For example, {'years','months'} is valid, but
{'months','years'} is not.
X1,X2,... — Output numeric and duration values arrays
Output numeric and duration values, returned as arrays.
split returns year, month, and day values in numeric
arrays and time values in duration arrays.
Data Types: double | duration
Extended Capabilities
Tall Arrays Calculate with arrays that have more rows than fit in memory.
This function fully supports tall arrays. For
more information, see Tall Arrays.