What statement should I put?

2 次查看(过去 30 天)
Zach Hanses
Zach Hanses 2021-12-14
What statement would show the days that fit the condition below?
for i = 1:length(n-1)
if (avePrecipitation7Days<1 & aveDailyTemp>2)
plantingDates = ????
end
end
Background: I am trying to find the most suitable days to plant. avePrecipitation7Days and aveDailyTemp are both 1x244.

回答(1 个)

Walter Roberson
Walter Roberson 2021-12-14
Something like this?
mask = (avePrecipitation7Days<1) & (aveDailyTemp>2);
Indicator = strings(size(mask));
Indicator(mask) = "GO";
Indicator(~mask) = "no"
Question: what are your units? millimetres of precipitation ? Degrees Celcius? Is that "average" for temperature including nighttime, or is it the daytime high?
If those are millimetres and Celcius, then where I live, you would be selecting April 7th to April 14th, and October 14th to October 21st only. Before April 7th the mean daily temperature is too low; after April 14th the 7 day average precipitation is too high. Before October 14th the 7 day average precipitation is too high; after October 21, the mean daily temperature is too low.
Early April is considered to be a minimum of one month too early to plant crops here: the ground has not thawed yet, and there too much chance of a frost. Mean daily temperature does not tell you much about frost risk: our averge high for April is 10C but our average low (considering the whole month) is -2C .

类别

Help CenterFile Exchange 中查找有关 Biological and Health Sciences 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by