【问题标题】:Using EJML, is there a quick way to find mean of columns of a matrix?使用 EJML,是否有一种快速查找矩阵列均值的方法?
【发布时间】:2017-05-30 06:58:51
【问题描述】:

正在寻找一个函数,它返回一个给出平均值的一维 SimpleMatrix。

【问题讨论】:

    标签: ejml


    【解决方案1】:

    不幸的是,没有内置函数可以做到这一点。不过,这应该可以解决问题:

    SimpleMatrix ones = new SimpleMatrix(1,10);
    ones.set(1);
    SimpleMatrix m = SimpleMatrix.random64(10,20,-1,2,new Random());
    
    SimpleMatrix sum = ones.mult(m);
    SimpleMatrix mean = sum.divide(10);
    

    【讨论】:

      猜你喜欢
      • 2022-12-12
      • 1970-01-01
      • 1970-01-01
      • 2023-04-05
      • 1970-01-01
      • 2011-09-08
      • 2011-09-24
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多