extracting value from a vector
1 次查看(过去 30 天)
显示 更早的评论
Hello everybody!
i need help extracting some values from a vector. More specifically, I have two vectors A and B (vector A contains 1: 3000 while vector B contains 10 random numbers) and I need to extract from vector A only the values contained in Vector B. I have already tried with "== "and" iseq ", but the vectors are not the same length and therefore I cannot perform the operation.
thank you for your time!
0 个评论
采纳的回答
Olof Engström
2021-3-18
[intersection, indices] = intersect(A,B)
There you get the intersecting values and the indices to the intersecting values in A
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!