0

Was looking for a function which returns a one diamensional SimpleMatrix giving the mean.

4

1 回答 1

0

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

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);
于 2017-01-17T19:47:28.787 回答