ismember in a different way
1 次查看(过去 30 天)
显示 更早的评论
Hello all, I have a vector X with numbers. These X vector numbers are numbers (indeces) for columns of another vector Y that are significant. Now I want to binarize my vector Y and set the values in Y that correspond with the indeces provided by vector X to 1s, and the rest of the vector Y to 0s.
example:
X = [1 2 5 9]; Y = [10 12 3 43 75 60 67 8 90]
result: Y = [1 1 0 0 1 0 0 0 1]
I tried to do it with ismember, but I do not think it will work for indexing - could you help? Thanks.
0 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Matrices and Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!