数组的最大元素
如果A
是一个向量,然后最大(A)
returns the maximum ofA
。
如果A
是矩阵,然后最大(A)
is a row vector containing the maximum value of each column.
如果A
是一个多维数组,然后最大(A)
operates along the first array dimension whose size does not equal1
,将元素视为向量。这个维度的大小变成1
尽管所有其他维度的尺寸保持不变。如果A
是一个empty array whose first dimension has zero length, then最大(A)
返回一个与相同大小的空数组A
。
___= max(___,“比较method”,
可选地指定如何比较任何先前语法的元素。例如,对于向量方法
)A = [-1 2 -9]
, the syntaxmax(a,[],'comparionmethod','abs')
比较A
according to their absolute values and returns-9
。