index.m - create a list of the indices and values of an array

버전 1.1.0.0 (1.98 KB) 작성자: Georg Stillfried
Create a list where each value (content) of an array is displayed together with its index.
다운로드 수: 1.1K
업데이트 날짜: 2009/5/26

라이선스 보기

This function displays each value of an array together with its index. It is possible to ignore zeros and/or NaNs and/or to sort the list according to value. The values can be integers or floating point numbers.

EXAMPLES:

>> a=[2,3,NaN;1,2,4;7,0,9];

>> index(a,'sorted')

ans =
3 2 0
2 1 1
1 1 2
2 2 2
1 2 3
2 3 4
3 1 7
3 3 9
1 3 NaN

>> index(a,'sorted','nonans','nozeros')

ans =
2 1 1
1 1 2
2 2 2
1 2 3
2 3 4
3 1 7
3 3 9

인용 양식

Georg Stillfried (2024). index.m - create a list of the indices and values of an array (https://www.mathworks.com/matlabcentral/fileexchange/21330-index-m-create-a-list-of-the-indices-and-values-of-an-array), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

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

faster through ind2sub

1.0.0.0

improved speed for large arrays