Info

Cette question est clôturée. Rouvrir pour modifier ou répondre.

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

1 vue (au cours des 30 derniers jours)
Pearl Lan
Pearl Lan le 8 Oct 2019
Clôturé : MATLAB Answer Bot le 20 Août 2021
%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.

Réponses (1)

Fabio Freschi
Fabio Freschi le 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,:);
  2 commentaires
Pearl Lan
Pearl Lan le 8 Oct 2019
yes it does, thank you so much!
Fabio Freschi
Fabio Freschi le 8 Oct 2019
My pleasure! If the answer solve your question, please accept it

Community Treasure Hunt

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

Start Hunting!

Translated by