Finding first value in an array equal to each number in a vector
4 次查看(过去 30 天)
显示 更早的评论
I can find the first value in test_array that is equal to 2 using the following:
find(test_array==2, 1, 'first')
But how do I find the first value in test_array that is equal to, say, a vector of values? So the first value, for example, that is equal to 3, the first value that is equal to 5, the first value that is equal to 7, etc.?
0 个评论
采纳的回答
Walter Roberson
2023-4-22
See the second output of ismember() -- you might need to exchange the parameters
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Line Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!