Main Content

isduration

Determine if input is duration array

Description

example

tf = isduration(t)returns logical1(true) iftis adurationarray. Otherwise, it returns logical0(false).

Examples

collapse all

Determine if the output of an arithmetic calculation is adurationarray.

Subtract adatetimearray from another.

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

Determine if the output is adurationarray.

tf = isduration(dt)
tf =logical1

Input Arguments

collapse all

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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2014b