Wrap index to select element in vector

버전 2.0.0 (1.09 KB) 작성자: Rubem Pacelli
Wrap index to select element in vector
다운로드 수: 29
업데이트 날짜: 2019/8/27

라이선스 보기

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

인용 양식

Rubem Pacelli (2025). Wrap index to select element in vector (https://kr.mathworks.com/matlabcentral/fileexchange/72540-wrap-index-to-select-element-in-vector), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2018a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Matrices and Arrays에 대해 자세히 알아보기
태그 태그 추가

Community Treasure Hunt

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

Start Hunting!
버전 게시됨 릴리스 정보
2.0.0

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

1.0.0