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

1 次查看(过去 30 天)
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.

采纳的回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2018-8-12
编辑:KALYAN ACHARJYA 2018-8-12
*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);

更多回答(1 个)

Johannes Deelstra
Johannes Deelstra 2018-8-12
thanks very much

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

标签

产品


版本

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by