Main Content

frameintervals

Create frame intervals based on frame settings

Description

frameintervals is a function used in code generated by Diagnostic Feature Designer.

intervals = frameintervals(range,framerate,framesize) creates frame intervals containing frame start and stop times for all frames within the specified range of data, using the specified frame rate and frame size.

For instance, suppose that your full signal starts at 0 and ends at 30 seconds. You specify contiguous one second frames by setting both framerate and framesize to 1. Then range is equal to [0 30] and intervals is returned as a table of 30 intervals that starts with the interval [0 1] and ends with the interval [29 30].

Code that is generated by Diagnostic Feature Designer uses frameintervals when performing frame-based member processing.

intervals = frameintervals(___,Name,Value) creates frame intervals using one or more name-value pair arguments. For instance, frameintervals('FrameUnit','days') returns frame intervals in the units of days. Specify name-value pair arguments after all other input arguments.

Input Arguments

collapse all

Data range over which to create frame intervals, specified as a numeric or duration vector with two elements.

Frame rate, which represents the distance between the starting points of each successive frame, specified as a numeric or duration value. By default, frameintervals interprets the units of framerate and framesize, and sets the units and data type of intervals, according to the data type and units of range as the table shows.

rangeframerate, framesizeUnits of framerate, framesizeintervalsUnits of intervals
numericnumericsame as rangenumericsame as range
durationnumericsecondsdurationseconds
durationdurationsame as rangedurationsame as range
durationdurationdifferent from rangedurationseconds

Frame size, which represents the distance between the start point and end point of each successive frame, specified as a numeric or duration value. By default, frameintervals interprets the units of framesize and framerate, and sets the units and data type of intervals, according to the data type and units of range. For more information, see the table in framerate.

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose Name in quotes.

Example: frameintervals('FrameUnit','days')

Frame units, specified as the comma-separated pair consisting of 'FrameUnit' and a string identifying the unit in which to return intervals. When framerate and framesize are numeric but range is duration, 'FrameUnit' also specifies the units of framerate and framesize.

Variable names for intervals, specified as the comma-separated pair consisting of 'VariableNames' and a string array with two strings representing the names for start points and end points.

Output Arguments

collapse all

Frame intervals, returned as an nf-by-2 table, where nf is the number of frames. By default, the data type and units of intervals depend on the data type and units of range and framerate. For more information, see framerate. The name-value pair argument framesize overrides the default units for intervals.

Version History

Introduced in R2020a