Help for running: 3 consecutive days of 95% daily mean temperature

4 vues (au cours des 30 derniers jours)
Lilja Dahl
Lilja Dahl le 10 Juin 2019
Modifié(e) : Lilja Dahl le 11 Juin 2019
My matrice M consist of (longitude, lattitude, days). M(61,15,10958)
To calculate the 95 percentile I take the mean:
M_mean = mean(M,3);
M_mean_pct = prctile(M_mean, 95)
Now I need help for running 3 consecutive days.
days = 0;
HW = 0;
for t = 1:size(M, 3)
if M(:,:,t) > M_mean_pct
days = days + 1;
if days >= 3;
HW = HW +1
HW ongoing = 1
else
HW = 0;
end
What I am trying to run is
for time = 1:days - time
if M(t) > pct95 --> days = days +1
if days > 3 --> heatwave (HW) = heatwave (HW) +1
if heatwave is already present (HW ongoing) = 1
If this is not the case, the heat wave (HW) = 0
Your answer is very much appreciated!

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by