Info

この質問は閉じられています。 編集または回答するには再度開いてください。

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

1 回表示 (過去 30 日間)
Pearl Lan
Pearl Lan 2019 年 10 月 8 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
%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,:);
  2 件のコメント
Pearl Lan
Pearl Lan 2019 年 10 月 8 日
yes it does, thank you so much!
Fabio Freschi
Fabio Freschi 2019 年 10 月 8 日
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