Remove Data Outside Range

19 次查看(过去 30 天)
Doug
Doug 2018-10-10
评论: Doug 2018-10-10
I am trying to remove data in both columns based on a data range for the first column. i.e. Col1<4 and Col1>20. And then within the new range determine the max value in Col2 and give me the corresponding value in Col1

采纳的回答

ANKUR KUMAR
ANKUR KUMAR 2018-10-10
AA=temp(temp(:,1)>=4 & temp(:,1)<=20,:);
There is no need to remove. Directly store the numbers which you need.
[xx,yy]=max(AA(:,1));
AA(yy,:)
  3 个评论
ANKUR KUMAR
ANKUR KUMAR 2018-10-10
Use this one,
[xx,yy]=max(AA(:,2));
AA(yy,:)
ans =
13.2813 0.0018
Doug
Doug 2018-10-10
Awesome, thanks for the help.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

产品


版本

R2017a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by