Programmer Guide/Command Reference/EVAL/imin: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
::*if <var>x</var> is a matrix: the result is the element index ''i'' of the minimum; the column ''c'' and the row ''r'' can be computed as follows: <code>''c'' := int ''i''/''x''[!nrow]</code>, <code>r := int ''i''%''x''[!nrow]</code> | ::*if <var>x</var> is a matrix: the result is the element index ''i'' of the minimum; the column ''c'' and the row ''r'' can be computed as follows: <code>''c'' := int ''i''/''x''[!nrow]</code>, <code>r := int ''i''%''x''[!nrow]</code> | ||
;See also: [[Programmer_Guide/Command_Reference/EVAL/min|min]], [[Programmer_Guide/Command_Reference/EVAL/absmin|absmin]], [[Programmer_Guide/Command_Reference/EVAL/ | ;See also: [[Programmer_Guide/Command_Reference/EVAL/min|min]], [[Programmer_Guide/Command_Reference/EVAL/absmin|absmin]], [[Programmer_Guide/Command_Reference/EVAL/imax|imax]], | ||
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] | [[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]] |
Revision as of 10:36, 4 April 2011
Returns the index of smallest value of argument x.
- Usage
imin(x)
- Result
- The result is the index of the minimum value of x.
- if x is a scalar: the result is 0
- if x is a vector: the result is the index (row) of the minimum
- if x is a matrix: the result is the element index i of the minimum; the column c and the row r can be computed as follows:
c := int i/x[!nrow]
,r := int i%x[!nrow]