m = 1x3 cell
{'September'}
{'October'}
{'November'}
You can retrieve the year, quarter, week, day, hour, minute, and second components of each datetime
in t using the year, quarter, week, hour, minute, and second functions, respectively.
Get the week of year numbers for each datetime in t.
w = week(t)
w = 1×3
36
41
44
Get Multiple Date and Time Components
Use the ymd function to get the year, month, and day values of t as three separate numeric arrays.
[y,m,d] = ymd(t)
y = 1×3
2021
2022
2023
m = 1×3
9
10
11
d = 1×3
2
3
4
Use the hms function to get the hour, minute, and second values of t as three separate numeric
arrays.
[h,m,s] = hms(t)
h = 1×3
10
6
2
m = 1×3
44
44
44
s = 1×3
38.3920
38.3920
38.3920
7 Dates and Time
7-24
Précédent

- 278/1450

Suivant