intensity of dought events

조회 수: 10 (최근 30일)
Nurul Ain Basirah Zakaria
Nurul Ain Basirah Zakaria 2021년 6월 12일
댓글: Nurul Ain Basirah Zakaria 2021년 6월 13일
Hi, I have a drought duration over time file. So, it is the drought duration event where it contains consecutive months of negative value, so, i need to calculate the mean intensity of each drought events, can I do it in matlab?

답변 (2개)

Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 12일
Use can use mean()
  댓글 수: 4
Nurul Ain Basirah Zakaria
Nurul Ain Basirah Zakaria 2021년 6월 12일
thank you sir! but out of my topic, can i detect the consecutive value from a range of data? for instance,
2 3 4 5 7 7 7 7 7 7 8 9 0 7 7 7 7 7 7 7 7 3 4 2 1
and then i want 7+7+7+7+7+7 divide by 6 as the first event, and then next consecutive 7, divide by 8? as the second event?
Sulaymon Eshkabilov
Sulaymon Eshkabilov 2021년 6월 12일
Here is a nice discussion on how to locate consequitive numbers:
You can find relevant comments and answers to this question of yours.

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


Image Analyst
Image Analyst 2021년 6월 12일
You need to use regionprops(), which will get you both the length of each drought, as well as it's mean value. You can also get the max value if you want with 'MaxIntensity':
d = [1 -2 -2 -4 -5 -1 3 3 -3 -4.5 -8 5 6 7] % 2 regions of negative runs
% Find negative regions - binarize.
bw = d < 0
% Make measurements
props = regionprops(bw, d, 'Area', 'MeanIntensity');
% Get the lengths of all the runs
droughtDurations = [props.Area]
% Get the mean value for each of the 2 runs
droughtIntensities = [props.MeanIntensity]
You get:
bw =
1×14 logical array
0 1 1 1 1 1 0 0 1 1 1 0 0 0
droughtDurations =
5 3
droughtIntensities =
-2.8 -5.16666666666667
  댓글 수: 9
Image Analyst
Image Analyst 2021년 6월 13일
OK we're getting there. So, say for a given long and lat, what if there are 5 or 10 or 15 droughts of longer than a certain duration during those 415 months? How do you convert that to a color? Do you simply sum up all the drought months over the 415 months?
Nurul Ain Basirah Zakaria
Nurul Ain Basirah Zakaria 2021년 6월 13일
i want it to be like this;
over the months of 415 months,
the consecutive -ve value, start with -ve and end with -ve value, is an event, so its okay if there are 5 or 10 or 15 drought months, as it is consecutive, it is a drought event.
the regionprops is okay but is it okay or can I apply it thru each grid over the 415 months?
is this okay sir?

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by