import java.util.Random;
import java.util.Arrays;
public class Example {
private static double[][] createMtrixWithRandomNumbers(int rows, int cols) {
double[][] randomMatrix = new double[rows][cols];
Random rand = new Random();
rand.setSeed(System.currentTimeMillis());
for (int i = 0; i < rows; i++) {
for (int j = 0; j < cols; j++) {
Integer num = rand.nextInt() % 100;
randomMatrix[i][j] = Math.abs(num);
}
}
return randomMatrix;
}
public static void main(String[] args) {
System.out.println(Arrays.deepToString(createMtrixWithRandomNumbers(4, 5)));
}
}
/*
run:
[[84.0, 92.0, 37.0, 70.0, 10.0], [6.0, 43.0, 46.0, 3.0, 32.0], [3.0, 53.0, 85.0, 41.0, 43.0], [83.0, 11.0, 76.0, 69.0, 77.0]]
*/