Problem 61087. How tall will my cactus be?
My Barbed Wire Cactus is a desert cactus that relies on just the right amount of rainfall to stay healthy. Given a 1×12 vector of monthly rainfall values (in mm), the cactus will die if any month has less than 10 mm of rain (too dry) or more than 150 mm (too wet). If it survives the year, the change in the average height of the cactus follows a realistic saturation model:
g = Gmax * (1 - exp(-r ./ k))
where Gmax = 5 cm is the maximum monthly growth and k = 40 mm controls how strongly rainfall influences growth. Find the final height if the initial height of my cactus is 140 mm. If my cactus dies, the height should be reported as 0.
Solution Stats
Problem Comments
-
1 Comment
William
on 30 Nov 2025 at 15:31
The problem description says that Gmax = 5 cm, but it must be 5 mm in order for the tests to work.
Solution Comments
Show commentsProblem Recent Solvers9
Suggested Problems
-
9 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!