DocumentationHelp CenterDocumentation
Determine if input is duration array
tf = isduration(t)
example
tf = isduration(t) returns logical 1 (true) if t is a duration array. Otherwise, it returns logical 0 (false).
t
1
true
duration
0
false
collapse all
Determine if the output of an arithmetic calculation is a duration array.
Subtract a datetime array from another.
datetime
t1 = datetime(2014,03,16:17); t2 = datetime(2014,03,20); dt = t2 - t1
dt = 1x2 duration 96:00:00 72:00:00
Determine if the output is a duration array.
tf = isduration(dt)
tf = logical 1
Input array, specified as a scalar, vector, matrix, or multidimensional array. t can be any data type.
This function fully supports distributed arrays. For more information, see Run MATLAB Functions with Distributed Arrays (Parallel Computing Toolbox).
duration | iscalendarduration | isdatetime
iscalendarduration
isdatetime
You have a modified version of this example. Do you want to open this example with your edits?
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office