필터 지우기
필터 지우기

separate rain events by specific dry period

조회 수: 1 (최근 30일)
Albert Johan Mamani Larico
Albert Johan Mamani Larico 2022년 5월 12일
댓글: Jovon Jacob 2023년 1월 8일
Hi
I have hourly rain data for a period of 5 years
x = [0 0 0 0 0 2 4 5 14 10 16 0 0 0 0 0 24 33 22 0 0 2 3 5 0 0 0 0.........]
I need to group them considering that each rain event is separated by 3 hours of zero values or more
How could I get the numbers of rain events, their mean rain value and duration of each event?

채택된 답변

Image Analyst
Image Analyst 2022년 5월 12일
Try this, if you have the Image Processing Toolbox.
x = [0 0 0 0 0 2 4 5 14 10 16 0 0 0 0 0 24 33 22 0 0 2 3 5 0 0 0 0]
props = regionprops(x > 0, x, 'Area', 'MeanIntensity')
numberOfRainPeriods = length(props)
stormLengths = [props.Area] % In hours
meanRainPerHour = [props.MeanIntensity] % In mm or whatever.
integratedRainTotalsPerStorm = stormLengths .* meanRainPerHour % In mm or whatever.
You get
numberOfRainPeriods =
3
stormLengths =
6 3 3
meanRainPerHour =
8.5 26.333 3.3333
integratedRainTotalsPerStorm =
51 79 10
  댓글 수: 3
Image Analyst
Image Analyst 2023년 1월 7일
@Jovon Jacob give an example. Input, and output vectors. Best if you start your own thread and attach this code as your starting code.
Jovon Jacob
Jovon Jacob 2023년 1월 8일

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by