Return filtered values from a matrix
1 次查看(过去 30 天)
显示 更早的评论
I have expressed my problem with the following image. I would like to implement exactly what I am saying on matlab but I am confused about how to do it.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1219602/image.png)
2 个评论
采纳的回答
Voss
2022-12-5
data = [321 -0.2; 937 -0.18; 23 -0.16; 472 -0.15; 964 -0.14; 375 -0.13; 902 -0.12; 462 -0.11; 842 0; 735 1; 328 2; 341 2.5; 421 3]
range_limits = [-0.3 -0.1];
range_limits = sort(range_limits);
in_range_rows = find(data(:,2) >= range_limits(1) & data(:,2) <= range_limits(2));
[max_val,idx] = max(data(in_range_rows,1));
max_row = in_range_rows(idx);
disp(max_row)
disp(data(max_row,:))
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Coordinate Transformations and Trajectories 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!