How to extract a data range in x and y co-ordinates from a table?

Hi! I was wondering if someone could help me...
I have a data set with four columns, x,y,I,t. Each data point represents a molecular coordinate. I need to find data points with raw x values in the range 22450-25450 and output in a separate file the x coordinate, the associated y, I and t coordinates!!
Thankyou in advance!

 Respuesta aceptada

To get the row indices corresponding to your desired ‘x’ values, use the find function. Assuming ‘data(:,1)’ is ‘x’:
xrow = find((data(:,1) >= 22450) & (data(:,1) <= 25450));
output = data(xrow,:);
I cannot test this (I don’t have your array).

4 comentarios

Thankyou this worked perfectly.
Star Strider
Star Strider el 22 de Oct. de 2015
Editada: Star Strider el 22 de Oct. de 2015
My pleasure!
The sincerest expression of appreciation here on MATLAB Answers is to Accept the Answer that most closely solves your problem.
Thank you!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre MATLAB en Centro de ayuda y File Exchange.

Preguntada:

el 19 de Oct. de 2015

Comentada:

el 6 de Nov. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by