Programmer Guide/Command Reference/EVAL/imax: Difference between revisions

From STX Wiki
Jump to navigationJump to search
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
{{DISPLAYTITLE:{{SUBPAGENAME}}}}
Returns the index of largest value of argument <var>x</var>.
Returns the index of largest value of argument <var>x</var>.
 
;Usage: <code>imax(<var>x</var>)</code>
;Usage: '''<code>imax(<var>x</var>)</code>'''
 
;Result: The result is the index of the maximum value of <var>x</var>.
;Result: The result is the index of the maximum value of <var>x</var>.
::*if <var>x</var> is a scalar: the result is '''0'''
::*if <var>x</var> is a scalar: the result is '''0'''
::*if <var>x</var> is a vector: the result is the index (row) of the maximum
::*if <var>x</var> is a vector: the result is the index (row) of the maximum
::*if <var>x</var> is a matrix: the result is the element index ''i'' of the maximum; 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 maximum; 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: [[../max|max]], [[../absmax|absmax]], [[../imin|imin]],


;See also: [[Programmer_Guide/Command_Reference/EVAL/max|max]], [[Programmer_Guide/Command_Reference/EVAL/absmax|absmax]], [[Programmer_Guide/Command_Reference/EVAL/imin|imin]],
[[../#Functions|<function list>]]
 
[[Programmer_Guide/Command_Reference/EVAL#Functions|<function list>]]

Latest revision as of 10:59, 21 April 2011

Returns the index of largest value of argument x.

Usage
imax(x)
Result
The result is the index of the maximum 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 maximum
  • if x is a matrix: the result is the element index i of the maximum; the column c and the row r can be computed as follows: c := int i/x[!nrow], r := int i%x[!nrow]
See also
max, absmax, imin,

<function list>

Navigation menu

Personal tools