Calculate weekly mean from temperature data
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!