Wrap index to select element in vector
Versione 2.0.0 (1,09 KB) da
Rubem Pacelli
Wrap index to select element in vector
This simple function does a circular selection (wrap the index) to select one element in a vector [1xN] or [Nx1]. It's work for negative values also.
Exemple:
A = (1:10)'
A =
1
2
3
4
5
6
7
8
9
10
wrapindex(A,12) = 2
wrapindex(A,-2) = 9
Cita come
Rubem Pacelli (2025). Wrap index to select element in vector (https://www.mathworks.com/matlabcentral/fileexchange/72540-wrap-index-to-select-element-in-vector), MATLAB Central File Exchange. Recuperato .
Compatibilità della release di MATLAB
Creato con
R2018a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS LinuxCategorie
Scopri di più su Matrices and Arrays in Help Center e MATLAB Answers
Tag
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Scopri Live Editor
Crea script con codice, output e testo formattato in un unico documento eseguibile.