how to select corresponding values to a column
2 次查看(过去 30 天)
显示 更早的评论
I have a data set with x and y...like 100 each in a column...x is a number..y is a value of a paramter
for x i have selected specific values say i have selected 1,15,30,45,60,75,90,100
now i want matlab to select corresponding values of y that are to x...
i know its simple but am dealing with something complex..juts need to know the quick answer. Thanks
0 个评论
采纳的回答
David Hill
2021-3-15
yourMatrix=[(1:100)',randi(100,100,1)];
y=yourMatrix([1,15,30,45,60,75,90,100],2);
2 个评论
David Hill
2021-3-16
yourMatrix=[(1:100)',randi(100,100,1)];
y=yourMatrix(ismember(yourMatrix(:,1),[1,15,30,45,60,75,90,100]),2);
更多回答(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!