Average of 5 locations for each time
1 回表示 (過去 30 日間)
古いコメントを表示
%Point Barrow, Alaska
PB=readtable('monthly_flask_co2_ptb.csv');
%create time and CO2 variable
%time
PBdailyt=PB(:,4);
%CO2
PBdailyCO2=PB(:,7);
%take data out of table and put into array
PBt=table2array(PBdailyt);
PBCO2=table2array(PBdailyCO2);
%index to extract outliers
idx = PBCO2 >=500 | PBCO2 <=300 ;
%set outliers equal to NaN
PBCO2(idx) = NaN;
I have 5 different locations, above I have included one of them. I am trying to calcuate the average of all 5 locations to plot against time. My goal is to have the 5 locations combined and plotted against time, and then to extrapolate it.
2 件のコメント
回答 (1 件)
Star Strider
2021 年 12 月 9 日
.
1 件のコメント
Star Strider
2021 年 12 月 9 日
Try this —
T1 = readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/828030/monthly_flask_co2_ptb.csv', 'VariableNamingRule','preserve', 'HeaderLines',56)
DTV = table(datetime(T1{:,1},T1{:,2},ones(size(T1{:,1}))), 'VariableNames',{'Date'});
T2 = [DTV, T1(:,5:end)]
T2.('Site Monthly Mean') = mean(T2{:,2:end},2)
Please be specific about what the desired result is, if this is not the desired result.
.
参考
カテゴリ
Help Center および File Exchange で Data Preprocessing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!