Documentation Center

  • Trial Software
  • Product Updates

min

Minimum of numbers

Use only in the MuPAD Notebook Interface.

This functionality does not run in MATLAB.

Syntax

min(x1, x2, , …)
min({x1, x2, …})
min([x1, x2, …])
min(A)

Description

min(x1, x2, ...) returns the minimum of the numbers x1, x2, ….

If the arguments of min are integers, rational numbers, or floating-point numbers, then min returns the numerical minimum of these arguments.

The call min() is illegal and leads to an error message. If there is only one argument x1, then min evaluates x1 and returns it. See Example 2.

If one of the arguments is -infinity, then min returns -infinity. If an argument is infinity, then it is removed from the argument list (see Example 3).

min returns an error when one of its arguments is a complex number or a floating point interval with on-zero imaginary part (see Example 2).

If one of the arguments is not a number, then a symbolic min call with the minimum of the numerical arguments and the remaining evaluated arguments may be returned (see Example 1).

Nested min calls with symbolic arguments are rewritten as a single min call, i.e., they are flattened; see Example 4.

min reacts to a very limited set of properties of identifiers set via assume. Use simplify to handle more general assumptions (see Example 4).

Examples

Example 1

min computes the minimum of integers, rational numbers, and floating-point values:

min(-3/2, 7, 1.4)

If the argument list contains symbolic expressions, then a symbolic min call is returned:

delete b: min(-4, b + 2, 1, 3)

In the following two examples, min is able to determine the minimum despite getting symbolic arguments:

min(sqrt(2), 1)

assume(x > 0): min(exp(x), exp(-x))

Floating point intervals are interpreted as "any number within this range" and may thus cause symbolic min calls to be returned:

min(2...3 union 6...7, 4)

min(2...3, 6...7, 4)

min(6...7, 4)

Example 2

min with one argument returns the evaluated argument:

delete a:
min(a), min(sin(2*PI)), min(2)

Complex numbers lead to an error message:

min(0, 1, I)
Error: The argument is invalid. [min]

Example 3

-infinity is always the minimum of arbitrary arguments:

delete x:
min(-100000000000, -infinity, x)

infinity is removed from the argument list:

min(-100000000000, infinity, x)

Example 4

min reacts only to very few properties of identifiers set via assume:

delete a, b, c:
assume(a > 0 and b > a and c > b):
min(a, min(b, c), 0)

An application of simplify yields the desired result:

simplify(%)

Parameters

x1, x2, …

Arbitrary MuPAD® objects

A

An array of domain type DOM_HFARRAY with real entries

Return Values

One of the arguments, a floating-point number, or a symbolic min call.

Overloaded By

See Also

MuPAD Functions

Was this topic helpful?