我在matlab中看到一个文件,在矩阵上使用了max(),其条目是复数。我无法理解matlab如何比较两个复数?
ls1=max(tfsp');
这里,tfsp包含复数。
答案 0 :(得分:5)
复数首先按幅度进行比较,然后按相位角进行比较(如果最大幅度存在平局。)
来自help max
:
When X is complex, the maximum is computed using the magnitude
MAX(ABS(X)). In the case of equal magnitude elements, then the phase
angle MAX(ANGLE(X)) is used.
NaN's are ignored when computing the maximum. When all elements in X
are NaN's, then the first one is returned as the maximum.