Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

quarter

Quarter number

Syntax

q = quarter(t)

Description

example

q = quarter(t) returns the quarter numbers for the datetime values in t. The q output is a double array containing integer values from 1 to 4, and is the same size as t.

Examples

collapse all

t = datetime(2013,05,31):calmonths(3):datetime(2014,05,31)
t = 1x5 datetime array
   31-May-2013   31-Aug-2013   30-Nov-2013   28-Feb-2014   31-May-2014

q = quarter(t)
q = 

     2     3     4     1     2

Input Arguments

collapse all

Input date and time, specified as a datetime array.

Extended Capabilities

See Also

| | |

Introduced in R2014b

Was this topic helpful?