Run-time efficiency: Cleaning wave date by removing values above calculated threshold

2 ビュー (過去 30 日間)
Peter Mills
Peter Mills 2018 年 1 月 18 日
編集済み: Peter Mills 2018 年 1 月 19 日
I would like to reduce the run-time of the attached code, all the files needed to make the code run are in the zip attached. This code currently takes 7.6 minutes to run.
load('SortedHS2009.mat')
tic
for i = 1:length(IndexOfStationsAraeaW)
stationid=genvarname(num2str(IndexOfStationsAraeaW(i)));
for imonth=1:12 %Jan to Dec
index=find(month(Date.(stationid))==imonth); %Find index for current month
[ToClean]=CleanDataV3(HS.(stationid),index); %Find index of values to set to NaN
HS.(stationid)(ToClean)=NaN; %Set them to NaN
end
end
toc

回答 (0 件)

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by