Wrap index to select element in vector
Version 2.0.0 (1,09 KB) von
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
Zitieren als
Rubem Pacelli (2025). Wrap index to select element in vector (https://de.mathworks.com/matlabcentral/fileexchange/72540-wrap-index-to-select-element-in-vector), MATLAB Central File Exchange. Abgerufen.
Kompatibilität der MATLAB-Version
Erstellt mit
R2018a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS LinuxKategorien
Mehr zu Matrices and Arrays finden Sie in Help Center und MATLAB Answers
Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Live Editor erkunden
Erstellen Sie Skripte mit Code, Ausgabe und formatiertem Text in einem einzigen ausführbaren Dokument.
| Version | Veröffentlicht | Versionshinweise | |
|---|---|---|---|
| 2.0.0 | Fix the bug on the last element ( x(N) ) |
||
| 1.0.0 |
