The minimum of the arguments. |
||
Syntax |
m,i = Min(a) m = Min(a, b) m = Min(a, [], dim) |
|
Argument |
Name |
Description |
a |
A vector or a matrix. It can also be a scalar when there are two arguments. |
|
b |
A scalar, vector or matrix. |
|
dim |
The dimension along which to find the minima. For columns dim = 1, and for rows, dim = 2. In the first form, dim is assumed to equal 1. |
|
Output |
Name |
Description |
m |
For two scalar inputs, it is the minimum of the two. For a single vector input, it is the minimum of the entries. For a single matrix input, the minimum of each row or column is returned in a vector, depending on the value of dim. For two matrix inputs, it is a matrix of the same size containing the minimum of each pair of elements. When a matrix is compared to a scalar, the scalar is treated as a matrix of elements equal to the scalar. |
|
i |
For vector inputs, the index to the minimum value is returned. For matrix inputs, the indices of the rows or columns (depending on the value of dim) containing the minimum values are returned. |
|
Example |
Find the minimum of elements in a matrix: |
|
Syntax |
||
M,I = Min([1,2;3,-4]) |
||
Result |
||
M = 1 -4 I = 1 2 |
||
Comments |
When the data is complex, it is compared by magnitude. Values of equal magnitude are then compared by phase. This can lead to unexpected results with respect to values with zero imaginary components. |
|
See Also: |