conditional array extraction based on control array
2 次查看(过去 30 天)
显示 更早的评论
I have the following problem:
For example, I have three arrays:
x = [1,2,3,4,5,6,7,8,9,10] and its corresponding y values: y = [21,43,77,54,38,24,99,64,77,33] and also a "control" array: c = [3,5,7,9]
Is it possible to somehow extract from 'y' only those entries that have corresponding entries in both 'x' and 'c' array and put them in for example 'z'? In this case z = [77,38,99,77]
Thanks.
0 个评论
采纳的回答
更多回答(2 个)
另请参阅
类别
在 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!