Calculate weekly mean from temperature data
이전 댓글 표시
Hi!
Can anyone help me to calculate weekly means of temperature data (td= SST - bottom temp difference) and salinity data? Time is from 1st of July till 31st of August 2022 (hour 12:00:00 for every day).
Could not attach the data as mat files they are too big. My variables include:
td(temperature difference) =783x1230x62 double
sal=4-D double
time = 62x1 datetime
My friend used this code for the same procedure, but I need to change the number of weeks as it's different from my data (she had 13 weeks). I also don't know how to interpret what she did in the calculations ( (w-1)*7+1:w*7) ) so don't know how to apply it to my data. Thanks in advance!
for w = 1:13
tdw(:,:,w) = mean(td(:,:,(w-1)*7+1:w*7),3);
salw(:,:,:,w) = mean(sal(:,:,:,(w-1)*7+1:w*7),4);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!