Next: , Previous: splu, Up: Function Reference


22.6.0.35 spmax

— Mapping Function: spmax (x, y, dim)
— Mapping Function: [w, iw] = spmax (x)

For a vector argument, return the maximum value. For a matrix argument, return the maximum value from each column, as a row vector, or over the dimension dim if defined. For two matrices (or a matrix and scalar), return the pair-wise maximum. Thus,

          max (max (x))
     

returns the largest element of x, and

          max (2:5, pi)
              =>  3.1416  3.1416  4.0000  5.0000
     

compares each element of the range 2:5 with pi, and returns a row vector of the maximum values.

For complex arguments, the magnitude of the elements are used for comparison.

If called with one input and two output arguments, max also returns the first index of the maximum value(s). Thus,

          [x, ix] = max ([1, 3, 5, 2, 5])
              =>  x = 5
                  ix = 3