q = quarter(t)
| Parameter | Description |
|---|---|
| inputs | datetime values, serial date numbers, or date-compatible input. |
| Parameter | Description |
|---|---|
| output | A double array with values from 1 to 4. |
Extract quarter numbers from date and time values.
quarter is computed from the calendar month using ceil(month(t)/3).
Array-valued inputs keep their data shape when the operation supports arrays. Scalar operands are expanded where the implementation defines scalar expansion.
quarter(datetime(2024, [1 4 7 10], 1))
| Version | Description |
|---|---|
| 2.0.0 | initial version |