Was looking for a function which returns a one diamensional SimpleMatrix giving the mean.
Asked
Active
Viewed 297 times
1 Answers
0
Unfortunately there isn't a built in function to do that. This should do the trick though:
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);

lessthanoptimal
- 2,722
- 2
- 23
- 25