array2ind

버전 1.0.0.0 (1.54 KB) 작성자: Greggory
A modification of the built-in sub2ind.
다운로드 수: 208
업데이트 날짜: 2011/8/25

라이선스 보기

Usage:

ind = array2ind(SIZE, COORDINATES_AS_ARRAY)

Example:

g = magic(5);
ind = array2ind([5 5], [3 2])
g(ind)

returns the same value as if you had called

g(3,2)

Useful for when the coordinates for a matrix element are stored as an array and avoids the current method of:

b = [3 2];
g(b(1), b(2))

While this is suitable for some cases, it's not generalized or adaptable to changing sizes of b and g.

인용 양식

Greggory (2025). array2ind (https://kr.mathworks.com/matlabcentral/fileexchange/32682-array2ind), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2011a
모든 릴리스와 호환
플랫폼 호환성
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!
버전 게시됨 릴리스 정보
1.0.0.0