Problem 42631. Cumulative minimum of an array
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 commentsGroup

Prime Numbers III
- 19 Problems
- 4 Finishers
- List the Moran numbers
- List the cuban primes
- Compute the largest number whose prime factors sum to n
- List the Beatriz numbers
- List the Euclid numbers
- List odd twin composites
- List the semiprimes
- Solve an equation involving primes and fractions
- List the two-bit primes
- List numbers such that every sum of consecutive positive integers ending in those numbers is composite
- Identify de Polignac numbers
- List the Fermi-Dirac primes
- Factor a number into Fermi-Dirac primes
- Compute the Sisyphus sequence
- Compute the bubble popper fidget spinner sequence
- Determine whether a number is a Zeisel number
- Express numbers as the sum of a prime, a square, and a cube
- Determine whether a number is a Gaussian prime
- List primes of the form xy+z
Problem Recent Solvers38
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!