【问题标题】:Get unique values in matrix with Matlab使用 Matlab 获取矩阵中的唯一值
【发布时间】:2019-03-31 21:24:08
【问题描述】:

我正在寻找使用 Matlab 获取矩阵中唯一值的最快方法!我有一个这样的矩阵:

1       2
1       2
1       3
1       5
1       23
2       1
3       1
3       2
3       2
3       2
4       17
4       3
4       17

并且需要得到这样的东西:

1       2
1       3
1       5
1       23
2       1
3       1
3       2
4       3
4       17

实际上我需要每行中的列组合的唯一值。

【问题讨论】:

    标签: arrays matlab matrix unique-values


    【解决方案1】:

    查看带有参数“rows”的 matlabs unique() 函数。

    C = unique(A,'rows')
    

    https://de.mathworks.com/help/matlab/ref/unique.html

    【讨论】:

      猜你喜欢
      • 2017-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-25
      • 2015-03-28
      相关资源
      最近更新 更多