Remove Data Outside Range

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

 Respuesta aceptada

ANKUR KUMAR
ANKUR KUMAR el 10 de Oct. de 2018

1 voto

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 comentarios

Doug
Doug el 10 de Oct. de 2018
Thanks for your response.
This does 1/2 of what I need, cause I need to keep the second column data and refer to the max in that column and get the associated value in the first. I know that my max in the second is 0.0018, which corresponds to 13.2318. So this is what I am trying to get
ANKUR KUMAR
ANKUR KUMAR el 10 de Oct. de 2018
Use this one,
[xx,yy]=max(AA(:,2));
AA(yy,:)
ans =
13.2813 0.0018
Doug
Doug el 10 de Oct. de 2018
Awesome, thanks for the help.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Productos

Versión

R2017a

Etiquetas

Preguntada:

el 10 de Oct. de 2018

Comentada:

el 10 de Oct. de 2018

Community Treasure Hunt

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

Start Hunting!

Translated by