Find the cumulative minimum of an array without using the built-in function cummin (and a few others). Your function should act identically to cummin, allowing the same inputs.
Examples
If X = [0 4 3
6 5 2]
cumin(X,1) is [0 4 3 and cumin(X,2) is [0 0 0
0 4 2] 6 5 2]
cumin(X,1,'reverse') is [0 4 2 and cumin(X,2,'reverse') is [0 3 3
6 5 2] 2 2 2]
Also, cumin([8 9 1 10 6 1 3 6 10 10]) returns [8 8 1 1 1 1 1 1 1 1]
cumin([8 9 1 10 6 1 3 6 10 10]') returns [8 8 1 1 1 1 1 1 1 1]'
See also cumax.
Solution Stats
Problem Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers45
Suggested Problems
-
Make the vector [1 2 3 4 5 6 7 8 9 10]
53433 Solvers
-
Sort a list of complex numbers based on far they are from the origin.
5811 Solvers
-
Project Euler: Problem 10, Sum of Primes
2127 Solvers
-
Convert a numerical matrix into a cell array of strings
2529 Solvers
-
Make a random, non-repeating vector.
11654 Solvers
More from this Author43
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!