time2num
Convert duration
or datetime
array into
numeric vector with the specified time unit
Since R2020a
Description
time2num
is a function used in code generated by Diagnostic Feature
Designer.
[
converts the time array x
,origUnit
] = time2num(T
,targetUnit
)T
from its original data type and unit into a
numeric vector x
expressed in the unit of
targetUnit
. For instance, suppose that T
is a
datetime
vector that contains timestamps for
data measurements, and you want to convert T
into a numeric vector
x
that expresses the time in units of hours. Use x =
time2num(T,"hours")
.
If x
is already a numeric vector, time2num
sets x
to T
and ignores
targetUnit
.
Code that is generated by Diagnostic Feature
Designer uses time2num
when performing spectral processing and
other computations.
Input Arguments
Output Arguments
Version History
Introduced in R2020a