フィルターのクリア

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
  1 件のコメント
Jon
Jon 2023 年 5 月 3 日
Glad that worked for you. Good luck with your work.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by