This is machine translation

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

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

isduration

Determine if input is duration array

Syntax

tf = isduration(t)

Description

example

tf = isduration(t) returns logical 1 (true) if t is a duration array. Otherwise, it returns logical 0 (false).

Examples

collapse all

Determine if the output of an arithmetic calculation is a duration array.

Subtract a datetime array from another.

t1 = datetime(2014,03,16:17);
t2 = datetime(2014,03,20);
dt = t2 - t1
dt = 1x2 duration array
   96:00:00   72:00:00

Determine if the output is a duration array.

tf = isduration(dt)
tf = logical
   1

Input Arguments

collapse all

Input array, specified as a scalar, vector, matrix, or multidimensional array. t can be any data type.

Extended Capabilities

Introduced in R2014b