Extract data with specific range
显示 更早的评论
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

采纳的回答
更多回答(1 个)
Arya Chandan Reddy
2023-6-29
编辑:Arya Chandan Reddy
2023-6-29
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.
类别
在 帮助中心 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!