<< cpsd | FOSSEE_Signal_Processing_Toolbox | cummin >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > cummax

# cummax

Compute the cumulative maximum.

### Syntax

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

### Parameters

A:

  Vector or matrix. Input array containing real or complex numbers.

dim:

  Positive integer. Dimension to operate along. Default is the first non-singleton dimension.

direction:

  String. Direction of cumulation. Can be 'forward' (default) or 'reverse'.

M:

  Vector or matrix. Cumulative maximum values.

iM:

  Vector or matrix. Indices of the maximum values.

### Description

This function computes the cumulative maximum of the input array `A`. For complex elements, the function compares magnitudes, and if magnitudes are equal, it compares phase angles. The operation can be performed along a specified dimension and in a specified direction.

### Examples

    //Cumulative maximum values in a vector:
    v = [8, 9, 1, 10, 6, 1, 3, 6, 10, 10];
    M = cummax(v)

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

    // Cumulative maximum with indices:
    [M, iM] = cummax(x, 2)

Report an issue
<< cpsd | FOSSEE_Signal_Processing_Toolbox | cummin >>