maxel
Maximum element of an array.
Syntax
Section titled “Syntax”v = maxel(A)v = maxel(A, absolute)Description
Section titled “Description”Returns the largest element in A. With absolute = true, compares |A(i)| and returns the element with the largest absolute value (preserving its sign). For complex A, the magnitude is used.
Kernel-level companion to max. User-facing code should call max(A) instead.
Examples
Section titled “Examples”maxel([3 -7 2 -1]) % 3maxel([3 -7 2 -1], true) % -7 (largest |x|)