findinterval
Versión 1.0.0 (14 KB) por
Austin Fite
Find the interval that bounds some measurement(s)
For each query point Q in QUERY, this function finds the first INDEX that satisfies Q >= LOWER(INDEX) && Q < UPPER(INDEX). This is a vectorized solution to the problem of finding the interval that bounds one or more points, where there may be gaps between each interval. Histcounts requires intervals to be contiguous, which is not always desirable.
Example:
% 0.5 second gap between intervals
t1 = 1:10;
t2 = 1.5:10.5;
query = [-1 1.25 1.75 4.25 15]; % only 2nd & 4th values are inside an interval
idx = findinterval(t1, t2, query)
% idx = [0 1 0 4 0]
Citar como
Austin Fite (2025). findinterval (https://la.mathworks.com/matlabcentral/fileexchange/108224-findinterval), MATLAB Central File Exchange. Recuperado .
Compatibilidad con la versión de MATLAB
Se creó con
R2022a
Compatible con cualquier versión desde R2014b
Compatibilidad con las plataformas
Windows macOS LinuxEtiquetas
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Descubra Live Editor
Cree scripts con código, salida y texto formateado en un documento ejecutable.
| Versión | Publicado | Notas de la versión | |
|---|---|---|---|
| 1.0.0 |