フィルターのクリア

I have an hourly meteorological data screenshot attached which i need to convert to average daily data. Since I have a long period of data it is difficult to do it in excel. If anyone knows how to code it in matlab pls let me know

2 ビュー (過去 30 日間)

採用された回答

Andrei Bobrov
Andrei Bobrov 2018 年 2 月 21 日
編集済み: Andrei Bobrov 2018 年 2 月 21 日
T = readtable('your_xls_file.xls');
t = datetime(strcat(T{:,2},'_',T{:,1}),'i','MM/dd/uuuu_HH:mm');
TT = table2timetable(T(:,3:end),'RowTimes',t);
E = regexp(TT{:,end},'\d+','match');
E = str2double(cat(1,E{:}));
tt = duration(E(:,1),E(:,2),0);
TT = [TT(:,1:end-1),table(tt,'v',TT.Properties.VariableNames(end))];
TTout = retime(TT,'daily','mean');
TTout = TTout(all(~isnan(TTout{:,:}),2),:);
or
T = readtable('your_xls_file.xls');
t = datetime(T{:,2});
A = regexp(T{:,end},'\d+','match');
A = str2double(cat(1,A{:}));
tt = duration(A(:,1),A(:,2),0);
TT = table2timetable([T(:,3:end-1),table(tt,'v',T.Properties.VariableNames(end))],'RowTimes',t);
TTout = varfun(@mean,TT,'GroupingVariables','Time');

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePower and Energy Systems についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by