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!