<< cummax | FOSSEE_Signal_Processing_Toolbox | db >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > cummin

# cummin

Compute the cumulative minimum.

### Syntax

    M = cummin(A)
    M = cummin(A, dim)
    M = cummin(_, direction)
    [M, iM] = cummin(..)

### Parameters

A:

  Real or complex numbers - vector or matrix.

dim:

  Positive integer - scalar (optional).

direction:

  String flag - 'forward' (default) or 'reverse' (optional).

### Description

The `cummin` function computes the cumulative minimum of the elements of the input array `A`. The operation is performed along the specified dimension or the first non-singleton dimension by default. If called with two output arguments, the index of the minimum value is also returned.

### Examples

    // 1) Cumulative minimum values in a vector
    v = [8 9 1 10 6 1 3 6 10 10];
    M = cummin(v)

    // 2) Cumulative minimum along a specific dimension
    x = [1 2 3; 4 1 2; 3 5 1];
    M = cummin(x, 2)

    // 3) Cumulative minimum with indices
    [M, iM] = cummin(x, 2)

    // 4) Cumulative minimum in reverse direction
    M = cummin(v, 'reverse')

Report an issue
<< cummax | FOSSEE_Signal_Processing_Toolbox | db >>