finding elements in a vector from another vector
古いコメントを表示
I'd like to create a vector y with the positions of the elements of x in m.
i.e.
x=0 (first element of x) has and index of 1 in m. So y(1)=1
x=241 (second element of x) has index of 242 in x. So y(2)=242
m and x are in attached
採用された回答
その他の回答 (1 件)
Fangjun Jiang
2020 年 7 月 18 日
編集済み: Fangjun Jiang
2020 年 7 月 18 日
[~,y]=ismember(x,m)
カテゴリ
ヘルプ センター および File Exchange で Mathematics についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!