【问题标题】:matlab identify position of min and maxmatlab识别最小值和最大值的位置
【发布时间】:2018-07-17 04:02:19
【问题描述】:

我有一个时间序列并计算了最小值、最大值和平均值。但是,我想知道最小和最大观察发生在哪一年。如何识别数据集中最小值和最大值的第 i 个位置?

【问题讨论】:

标签: matlab time-series max min


【解决方案1】:

您可以使用find 命令找到它。

例如:

M = [1992, 3 ,5; 1997, 8 ,2; 2000, 2, 15]
[~,min_i] = min(M(:,2)) %return the row index of min vaule in the 2nd column.
year_of_min = M(min_i,1)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-04-02
    相关资源
    最近更新 更多