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!