Binary search in the style of numpy's searchsorted
Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
Finds indices in sorted vector x where values would be inserted to maintain sorted order: in style of numpy searchsorted.
indices = searchsorted(x, values)
name value arguments (nv):
'side' (default: 'left')
e.g., side='left': x = [1, 3, 5, 5, 7], values = [2, 5, 7] -> indices = [2, 3, 5]
side='right': x = [1, 3, 5, 5, 7], values = [2, 5, 7] -> indices = [2, 4, 5]
'sortfirst' (default: false)
if true, x will be sorted prior to the search.
Credit: DrGar
(https://stackoverflow.com/questions/20166847/faster-version-of-find-for-sorted-vectors-matlab)
Amended by Luke Jenkins, Apr 2024
Cita come
Luke Jenkins (2026). searchsorted (https://it.mathworks.com/matlabcentral/fileexchange/163511-searchsorted), MATLAB Central File Exchange. Recuperato .
Informazioni generali
- Versione 1.0.0 (2,01 KB)
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
| Versione | Pubblicato | Note della release | Action |
|---|---|---|---|
| 1.0.0 |
