min(x [,squeeze:T] [,silent:T,undefval:U]), x REAL or LOGICAL or a structure with REAL or LOGICAL components, U a REAL scalar min(x, dimensions:J [,squeeze:T] [,silent:T,undefval:U]), vector of positive integers J min(x, margins:K [,squeeze:F] [,silent:T,undefval:U]), vector of positive integers K min(x1,x2,... [,silent:T,undefval:U]), x1, x2, ... REAL or LOGICAL vectors, all the same type. |

min(x) computes the minimum of the elements of a REAL or LOGICAL vector x. If x is LOGICAL, True is interpreted as 1.0 and False as 0.0 and hence min(x) is 0.0 if any element of x is False, and 1.0 if all elements are True. If x is a m by n matrix, min(x) computes a row vector (1 by n matrix) consisting of the minima of the elements in each column of x. If x is an array with dimensions n1, n2, n3, ..., y <- min(x) computes an array with dimensions 1, n2, n3, ... such that y[1,j,k,...] = min(x[i,j,k,...], i=1,...,n1). This is consistent with what happens when x is a matrix. Note: MacAnova3.35 and earlier produced a result with dimensions n2, n3, ... . min(x, squeeze:T) does the same, except the first dimension of the result (of length 1) is squeezed out unless the result is a scalar. In particular, if x is a matrix, min(x,squeeze:T) will be identical to vector(min(x)), and if x is an array, min(x,squeeze:T) will be identical to array(min(x),dim(x)[-1]). min(NULL) is NULL. min(a,b,c,...) is equivalent to min(vector(a,b,c,...)) if a, b, c, ... are all vectors. They must all have the same type, REAL or LOGICAL, or be NULL. min(NULL, NULL, ..., NULL) is NULL. min(x, silent:T) or min(a,b,c,...,silent:T) does the same but suppresses warning messages about MISSING values. If all the elements of a vector x are MISSING, min(x) is MISSING. min(x, undefval:U), where U is a REAL scalar does the same, except the returned value is U when all the elements of x are MISSING. min(x, dimensions:J [,squeeze:T] [,silent:T] [undefval:U]) finds the minimum over the dimensions in J = vector(j1,j2,...,jn) where j1, ..., jn are distinct positive integers <= ndims(x). Without 'squeeze:T', the result has the same number of dimensions as x, with dimensions j1, j2, ..., jn of length 1. With 'squeeze:T', these dimensions are removed from the result. The order of j1, j2, ... is ignored. It is an error if max(J) > ndims(x) or if there are duplicate elements in J. For example, if x is a matrix, min(x, dimensions:2) computes the row minima as a nrows(x) by 1 matrix and min(x, dimensions:2,squeeze:T) computes them as a one dimensional vector. min(x, margins:K [,squeeze:F] [,silent:T] [undefval:U]) finds the minima over the dimensions not in K = vector(k1, k2, ..., km), where k1, ..., km are distinct positive integers <= ndims(x). This computes minima for the margins specified in K. Without 'squeeze:F', only the dimensions in K are retained in the result. Otherwise the other dimensions are retained but have length 1. This is opposite from the default with 'dimensions:J'. It is an error if max(K) > ndims(x) or if there are duplicate elements in K. If x is a structure, min(x [dimensions:J or margins:K] [,squeeze:T or F] [,silent:T] [undefval:U]) computes a structure, each of whose components is min() applied to that component of x. Examples: Cmd> x # matrix with labels B1 B2 A1 18 15 A2 17 26 A3 18 19 Cmd> min(x) # minima down columns B1 B2 (1) 17 15 Cmd> min(x,dimensions:2) # minima across rows; 3 by 1 matrix (1) A1 15 A2 17 A3 18 Cmd> min(x,dimensions:2,squeeze:T) # same, length 3 vector A1 A2 A3 15 17 18 Cmd> min(x,margins:1) # same as preceding A1 A2 A3 15 17 18 See also topics max(), 'NULL'.

Gary Oehlert 2003-01-15