IAMAX
IAMAX[x]
gives the position of the element with the maximum absolute value in a vector x.
Details and Options
- To use IAMAX, you first need to load the BLAS Package using Needs["LinearAlgebra`BLAS`"].
- The following argument must be given:
-
x input expression vector - For complex vectors x, IAMAX locates the element with the greatest sum of absolute values of the real and imaginary parts.
- If x contains non-numeric elements, then IAMAX[x] always returns $Failed.
- For duplicate entries the first position found is returned.
Examples
open allclose allBasic Examples (1)Summary of the most common use cases
Scope (4)Survey of the scope of standard use cases

https://wolfram.com/xid/0gcd7rjqvunx9h3oe7x1p8-0i0euc


https://wolfram.com/xid/0gcd7rjqvunx9h3oe7x1p8-69hbpj

An arbitrary-precision vector:

https://wolfram.com/xid/0gcd7rjqvunx9h3oe7x1p8-mj87da

Vectors with symbolic entries will return $Failed:

https://wolfram.com/xid/0gcd7rjqvunx9h3oe7x1p8-0z7tup

Properties & Relations (1)Properties of the function, and connections to other functions
Possible Issues (2)Common pitfalls and unexpected behavior
If there are multiple elements with the same maximum absolute value, the position of the first one is returned:

https://wolfram.com/xid/0gcd7rjqvunx9h3oe7x1p8-da5kto

If a vector contains a symbol, IAMAX returns $Failed:

https://wolfram.com/xid/0gcd7rjqvunx9h3oe7x1p8-egjmlj

Wolfram Research (2017), IAMAX, Wolfram Language function, https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
Text
Wolfram Research (2017), IAMAX, Wolfram Language function, https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
Wolfram Research (2017), IAMAX, Wolfram Language function, https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
CMS
Wolfram Language. 2017. "IAMAX." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
Wolfram Language. 2017. "IAMAX." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
APA
Wolfram Language. (2017). IAMAX. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html
Wolfram Language. (2017). IAMAX. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html
BibTeX
@misc{reference.wolfram_2024_iamax, author="Wolfram Research", title="{IAMAX}", year="2017", howpublished="\url{https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html}", note=[Accessed: 23-April-2025
]}
BibLaTeX
@online{reference.wolfram_2024_iamax, organization={Wolfram Research}, title={IAMAX}, year={2017}, url={https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html}, note=[Accessed: 23-April-2025
]}