Remove Data Outside Range

20 Ansichten (letzte 30 Tage)
Doug
Doug am 10 Okt. 2018
Kommentiert: Doug am 10 Okt. 2018
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

Akzeptierte Antwort

ANKUR KUMAR
ANKUR KUMAR am 10 Okt. 2018
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 Kommentare
ANKUR KUMAR
ANKUR KUMAR am 10 Okt. 2018
Use this one,
[xx,yy]=max(AA(:,2));
AA(yy,:)
ans =
13.2813 0.0018
Doug
Doug am 10 Okt. 2018
Awesome, thanks for the help.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Tags

Produkte


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by