Info

此问题已关闭。 请重新打开它进行编辑或回答。

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

1 次查看(过去 30 天)
%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.

回答(1 个)

Fabio Freschi
Fabio Freschi 2019-10-8
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!

Translated by