Main Content

shortensigroi

Shorten signal regions of interest from left and right

Since R2020b

Description

roilimsout = shortensigroi(roilims,sl,sr) shortens the signal regions of interest specified in roilims from the left by sl samples and from the right by sr samples. The function removes all regions of length sl + sr or less.

example

Examples

collapse all

Create a two-column matrix of integers that can represent regions of interest of a signal. Shorten the regions of interest by three samples from the left and two samples from the right. shortensigroi removes regions of interest that are shortened by more than their length.

rois = [1 10; 17 26; 24 32; 38 40];

xrois = shortensigroi(rois,3,2)
xrois = 3×2

     4     8
    20    24
    27    30

Input Arguments

collapse all

Region-of-interest limits, specified as a two-column matrix of positive integers. The ith row of roilims contains nondecreasing indices corresponding to the beginning and end samples of the ith region of interest of a signal.

Example: [5 8; 12 20; 18 25] specifies a two-column region-of-interest matrix with three regions.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Number of samples to shorten from the left, specified as a nonnegative integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Number of samples to shorten from the right, specified as a nonnegative integer.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64

Output Arguments

collapse all

Modified region-of-interest limits, returned as a two-column matrix of positive integers. Output limits are returned in sorted order using the sortrows function.

Extended Capabilities

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

Version History

Introduced in R2020b