Trying to count number of occurrences that exceed a threshold over a certain amount of time.

I am trying to count how many times the difference between two temperatures is less than 5 degrees. I want the code to only count the amount of times when the temperatures are within 5 degrees of eachother cosistently for 1 hour or more and ignore the times when they are within 5 degrees of each other for times shorter than 1 hour. I am doing data points that span 744 hours or one month.

 채택된 답변

KSSV
KSSV 2022년 2월 23일
편집: KSSV 2022년 2월 23일
if T is your temperature array.
dT = diff(T) ;
nnz(dT<5)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Logical에 대해 자세히 알아보기

질문:

2022년 2월 23일

편집:

2022년 2월 23일

Community Treasure Hunt

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

Start Hunting!

Translated by