information about the number of times temperature changes from negative to positive

1 vue (au cours des 30 derniers jours)
Hello
I have a time series with daily temperatures. The time series is starting with negative temperature. After some days the temperature is shifting from negative to positive and after some days back to negative. How can I get information about the number of times the temperature has changed from negative to positive.

Réponse acceptée

KALYAN ACHARJYA
KALYAN ACHARJYA le 12 Août 2018
Modifié(e) : KALYAN ACHARJYA le 12 Août 2018
*Consider the temperatures as a vector a
count=0;
for i=1:length(a)-1
if a(i)<0 && a(i+1)>0
count=count+1;
end
end
disp(count);

Plus de réponses (1)

Johannes Deelstra
Johannes Deelstra le 12 Août 2018
thanks very much

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by