isduration - Determine if input is duration array - MATLAB (original) (raw)

Main Content

Determine if input is duration array

Syntax

Description

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

example

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 = 1×2 duration 96:00:00 72:00:00

Determine if the output is a duration array.

Input Arguments

collapse all

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

Extended Capabilities

Version History

Introduced in R2014b