Java Random Int randomDoubleMatrix(int rows, int columns)

Here you can find the source of randomDoubleMatrix(int rows, int columns)

Description

Creates a random matrix.

License

Open Source License

Parameter

Parameter Description
rows number of rows
columns number of columns

Return

random integer matrix

Declaration

public static double[][] randomDoubleMatrix(int rows, int columns) 

Method Source Code

//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;
    }
}

Related

  1. randomByteAsInt()
  2. randomBytes(int size)
  3. randomBytes(int size)
  4. randomCommon(int min, int max, int n)
  5. randomCommonStr(int min, int max, int n)
  6. randomFloatInInterval(float lower, float upper)
  7. randomHex(int length)
  8. randomHexOfInt(int min, int max)
  9. randomInIntervall(float low, float high)