matlab max的用法,Matlab max()函數的用法

Matlab中max函數在矩陣中求函數大小的實例如下:

C = max(A)

返回一個數組各不同維中的最大元素。

如果A是一個向量,max(A)返回A中的最大元素。

如果A是一個矩陣,max(A)將A的每一列作為一個向量,返回一行向量包含了每一列的最大元素。

如果A是多為數組,max(A) treats the values along the first non-singleton dimension as vectors, returning the maximum value of each vector.

C = max(A,B)

返回一個和A和B同大小的數組,其中的元素是從A或B中取出的最大元素。

C = max(A,[],dim)

返回A中有dim指定的維數范圍中的最大值。

[C,I] = max(…)

找到A中那些最大值的索引位置,將他們放在向量I中返回。如果這里有多個相同最大值時,返回的將是第一個的索引。

max

Maximum elements of an array

Syntax

C = max(A)

C = max(A,B)

C = max(A,[],dim)

[C,I] = max(…)

Description

C = max(A) returns the largest elements along different dimensions of an array. If A is a vector, max(A) returns the largest element in A. If A is a matrix, max(A) treats the columns of A as vectors, returning a row vector containing the maximum element from each column. If A is a multidimensional array, max(A) treats the values along the first non-singleton dimension as vectors, returning the maximum value of each vector.

C = max(A,B) returns an array the same size as A and B with the largest elements taken from A or B.

C = max(A,[],dim) returns the largest elements along the dimension of A specified by scalar dim. For example, max(A,[],1) produces the maximum values along the first dimension (the rows) of A.

[C,I] = max(…) finds the indices of the maximum values of A, and returns them in output vector I. If there are several identical maximum values, the index of the first one found is returned.

Remarks

For complex input A, max returns the complex number with the largest complex modulus (magnitude), computed with max(abs(A)), and ignores the phase angle, angle(A). The max function ignores NaNs.

See Also

isnan, mean, median, min, sort

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值