Here you can find the source of randomDoubleMatrix(int rows, int columns)
Parameter | Description |
---|---|
rows | number of rows |
columns | number of columns |
public static double[][] randomDoubleMatrix(int rows, int columns)
//package com.java2s; //License from project: Open Source License public class Main { /**// ww w .ja v a 2s . co m * Creates a random matrix. The values are from 0 to 1 * @param rows number of rows * @param columns number of columns * @return random integer matrix */ public static double[][] randomDoubleMatrix(int rows, int columns) { double[][] matrix = new double[rows][columns]; for (int i = 0; i < matrix.length; i++) { for (int j = 0; j < matrix[i].length; j++) { matrix[i][j] = Math.random(); } } return matrix; } }