Wrap index to select element in vector

Wrap index to select element in vector
27 téléchargements
Mise à jour 27 août 2019

Afficher la licence

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

Citation pour cette source

Rubem Pacelli (2024). 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. Récupéré le .

Compatibilité avec les versions de MATLAB
Créé avec R2018a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et MATLAB Answers
Tags Ajouter des tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Publié le Notes de version
2.0.0

Fix the bug on the last element ( x(N) )

1.0.0