How to quickly find the indecies of elements in an array?
조회 수: 1 (최근 30일)
이전 댓글 표시
Dear All,
I have an array A which contains integers. I have another array B. I want to find out the indecis of B in A.
For example, A = [1 9 2 8 3 7 4 6 5], B = [5 6 7]. The indecis of B in A is [9 8 6].
Thanks.
Benson
댓글 수: 0
채택된 답변
per isakson
2021년 5월 23일
편집: per isakson
2021년 5월 23일
A = [1 9 2 8 3 7 4 6 5];
B = [5 6 7];
[~,ix] = ismember( B, A )
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Downloads에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!