Info

This question is closed. Reopen it to edit or answer.

How to extract numbers with its corresponding numbers in the next column from a file?

1 view (last 30 days)
%Start
%Remove the values that are greater than 1000 and the corresponding times
UD=load('APP_C20_1_Press_Unfiltered.txt');
Unfiltered_Data=UD(:,2);
for k=1:length(Unfiltered_Data)
if Unfiltered_Data(k)>1000
Filtering_Data=Unfiltered_Data(Unfiltered_Data>1000);
end
end
I've figured how to extract the numbers greater than 1000 but I can't figure out how to extract its corresponding times, I don't even know where to begin, thank you so much for your help.

Answers (1)

Fabio Freschi
Fabio Freschi on 8 Oct 2019
Does this solve your question?
% complete data
UD = load('APP_C20_1_Press_Unfiltered.txt');
DataGreaterThan1000 = UD(UD(:,2) > 1000,:);
DataLowerThan1000 = UD(UD(:,2) <= 1000,:);

Community Treasure Hunt

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

Start Hunting!