IAMAX[x]
gives the position of the element with the maximum absolute value in a vector x.
IAMAX
IAMAX[x]
gives the position of the element with the maximum absolute value in a vector x.
更多信息和选项
- 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.
范例
打开所有单元 关闭所有单元基本范例 (1)
Scope (4)
IAMAX[{2.3, 4.1, -8.5, -2.6}]IAMAX[{2. + 3.1I, -4 + 2.1I, 10.I}]An arbitrary-precision vector:
IAMAX[{1`20, 12`20, 3`20, 6`20}]Vectors with symbolic entries will return $Failed:
IAMAX[{v1, v2, v3}]Properties & Relations (1)
IAMAX[x] is equivalent to Part[Position[Abs[x],Max[Abs[x]]],1,1] for real-valued vectors:
x = RandomReal[{-1, 1}, {5}];
IAMAX[x] === Part[Position[#, Max[#]], 1, 1]&[Abs[x]]A similar relation is true for complex-valued vectors :
x = RandomComplex[{-1 - I, 1 + I}, {5}];
IAMAX[x] === (Part[Position[#, Max[#]], 1, 1]&)[Abs[Re[x]] + Abs[Im[x]]]Possible Issues (2)
If there are multiple elements with the same maximum absolute value, the position of the first one is returned:
IAMAX[{2, 3, 1, 0, -3, 3}]If a vector contains a symbol, IAMAX returns $Failed:
Clear[s];
IAMAX[{1, s, 3}]文本
Wolfram Research (2017),IAMAX,Wolfram 语言函数,https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
CMS
Wolfram 语言. 2017. "IAMAX." Wolfram 语言与系统参考资料中心. Wolfram Research. https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html.
APA
Wolfram 语言. (2017). IAMAX. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html 年
BibTeX
@misc{reference.wolfram_2026_iamax, author="Wolfram Research", title="{IAMAX}", year="2017", howpublished="\url{https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html}", note=[Accessed: 19-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_iamax, organization={Wolfram Research}, title={IAMAX}, year={2017}, url={https://reference.wolfram.com/language/LowLevelLinearAlgebra/ref/IAMAX.html}, note=[Accessed: 19-June-2026]}