How to take values above threshold with the certain consecutive days?
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi All, I have temperature data 76x80x12052 defining longitude x latitude xs temperature value. also an array 1 x 12052 as the datetime.
I want to take a temperature value above threshold with the minimum 5 consecutive days.
I used this code
[latGrid, lonGrid] = meshgrid(1:80,1:76);
tResult = table(latGrid(:),lonGrid(:),'VariableNames',{'lat','lon'});
tResult.extData = cell(height(tResult),1);
for kk1 = 1:height(tResult)
% break down into 1-D problem and apply the original answer
lat = tResult.lat(kk1);
lon = tResult.lon(kk1);
idx0 = bwareafilt(squeeze(idx(lon,lat,:)),[5,Inf]);
a0 = squeeze(sst2(lon,lat,:));
label = bwlabel(idx0);
N = cell(max(label),1);
for kk2 = 1:max(label)
N{kk2} = a0(label == kk2);
end
tResult.extData{kk1} = N;
end
then the output is the table with the cell containing the group of temperature values which above the threshold:
However, the table does not include the date time. So, is there a way to include the date time in the output so I can know the time when the temperature exceeds the temperature?
Thank you
댓글 수: 1
Image Analyst
2021년 5월 1일
Probably. But I'm not going to try anything until you attach your data in a .mat file. Make it easy for us to help you, not hard.
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Time Series Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!