<?xml version="1.0" encoding="UTF-8"?>

<!--
 *
 * This help file was generated from cummax.sci using help_from_sci().
 *
 -->

<refentry version="5.0-subset Scilab" xml:id="cummax" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:scilab="http://www.scilab.org"
          xmlns:db="http://docbook.org/ns/docbook">

  <refnamediv>
    <refname>cummax</refname>
    <refpurpose>Compute the cumulative maximum.</refpurpose>
  </refnamediv>


<refsynopsisdiv>
   <title>Syntax</title>
   <synopsis>
   M = cummax(A)
   M = cummax(A, dim)
   M = cummax(_, direction)
   [M, iM] = cummax(...)
   
   </synopsis>
</refsynopsisdiv>

<refsection>
   <title>Parameters</title>
   <variablelist>
        <varlistentry>
            <term>A:</term>
            <listitem><para> Vector or matrix. Input array containing real or complex numbers.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>dim:</term>
            <listitem><para> Positive integer. Dimension to operate along. Default is the first non-singleton dimension.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>direction:</term>
            <listitem><para> String. Direction of cumulation. Can be 'forward' (default) or 'reverse'.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>M:</term>
            <listitem><para> Vector or matrix. Cumulative maximum values.</para></listitem>
        </varlistentry>
        <varlistentry>
            <term>iM:</term>
            <listitem><para> Vector or matrix. Indices of the maximum values.</para></listitem>
        </varlistentry>
   </variablelist>
</refsection>

<refsection>
   <title>Description</title>
   <para>
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.
   </para>
   <para>
</para>
</refsection>

<refsection>
   <title>Examples</title>
   <programlisting role="example"><![CDATA[
//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)

   ]]></programlisting>
</refsection>
</refentry>
