필터 지우기
필터 지우기

Use a subset of number to find the index in a bigger set

조회 수: 1 (최근 30일)
Reuben Addison
Reuben Addison 2023년 5월 2일
댓글: Jon 2023년 5월 3일
I want to use a subset of number to find the index in a bigger set
eg bigger set BS = [2.33, 4.55, 5.88, 3.98, 4.66, 7.99, 2.33, 9.55]
smaller set SS = [4.55 4.66 7.99]
I want to use the smaller set (SS) to pick the inex of its location in the bigger set (BS)
I tried using find, ismember but not working well

채택된 답변

Jon
Jon 2023년 5월 2일
BS = [2.33, 4.55, 5.88, 3.98, 4.66, 7.99, 2.33, 9.55];
SS = [4.55 4.66 7.99];
idx = find(ismember(BS,SS))
idx = 1×3
2 5 6

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by