Find Index Positions of a Small Array values in a Global Array

Hi guys,
I have a "global" array: Global = [1; 4; 6; 9; 13; 17; 26; 33; 47].
And a "small" array: Small = [6; 26; 47]
How can I find the positions of the "small" array values into the "Global" array? The result would be: Result = [3 7 9]
Thanks! Nicolas

 채택된 답변

KL
KL 2017년 11월 20일
편집: KL 2017년 11월 20일
G = [1; 4; 6; 9; 13; 17; 26; 33; 47];
S= [6; 26; 47];
find(ismember(G,S))
ans =
3
7
9

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Data Types에 대해 자세히 알아보기

질문:

2017년 11월 20일

편집:

KL
2017년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by