binmask2sigroi
Description
Examples
Convert Binary Sequence to ROI Limits
Consider a logical sequence that is true for samples belonging to four possible regions of interest of a signal. Convert the sequence to a two-column matrix of ROI limits.
mask = logical([0 0 1 1 1 1 0 0 0 0 1 1 1 0 0 0 0 0 1 1 1 1 1 1 1 1 1 0 0 0 1 1 0 0]); roilims = binmask2sigroi(mask)
roilims = 4×2
3 6
11 13
19 27
31 32
Input Arguments
mask
— Binary mask
logical vector | numeric vector
Binary mask, specified as a logical vector. You can also specify
mask
as a numeric vector. In that case, any nonzero element of
the vector is converted to logical 1
(true
) and
zeros are converted to logical 0
(false
).
Example: logical([0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0])
specifies a binary mask containing four regions of interest.
Example: [0 0 1 1 1 0 0 0 1 1 0 0 0 0 1 1 1 1 1 0 1 1 0]
specifies
a binary mask containing four regions of interest.
Data Types: single
| double
| int8
| int16
| int32
| int64
| uint8
| uint16
| uint32
| uint64
| logical
Output Arguments
roilims
— Region-of-interest limits
two-column matrix of positive integers
Region-of-interest limits, returned 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.
Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
GPU Arrays
Accelerate code by running on a graphics processing unit (GPU) using Parallel Computing Toolbox™.
This function fully supports GPU arrays. For more information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced in R2020b
See Also
Objects
Functions
Abrir ejemplo
Tiene una versión modificada de este ejemplo. ¿Desea abrir este ejemplo con sus modificaciones?
Comando de MATLAB
Ha hecho clic en un enlace que corresponde a este comando de MATLAB:
Ejecute el comando introduciéndolo en la ventana de comandos de MATLAB. Los navegadores web no admiten comandos de MATLAB.
Select a Web Site
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:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)