Extract data with specific range
Show older comments
Hi all, I have this data with 3 columns and 96824 rows.
So, what i want is that only data between 12 to 15 value that represented in first line and correspoding the columns data.
for example: first rows can included data I want something like: 9.7; 1.2393; 59.7758.
Thank you so much

Accepted Answer
More Answers (1)
Arya Chandan Reddy
on 29 Jun 2023
Edited: Arya Chandan Reddy
on 29 Jun 2023
Hi, as I can see you are trying to select rows with data within the specified range. Assuming that "first line" in the second sentence of your query means "first column" (i.e : select those rows whose first column lies between 12 and 15) you can try something like:
idx = A(:,1) > 12 & A(:,1) < 15; %corresponding indices are set to 1
extractedData = A(idx, :);
Hope it helps.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!