1.0.6 • Published 1 year ago

randgenmatrix v1.0.6

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

randgenMatrix-npm-pakcage (under development)

randgenMatrix

Generate array or matrix of random number with specified range, size, decimal, and export to txt or csv file.

Installation

npm install randgenmatrix

Usage

GenerateRandomArray

Generate an array of random number. min and max specifies the range, length specifies the number of elements, decimal specifies the number of digits to be saved after decimal point.

GenerateRandomArray(length, min, max, decimal)

Example:

GenerateRandomCol(7, 56, 80, 2)

Returns:

(7) '79.11', '67.02', '65.51', '70.45', '75.17', '76.71', '62.92'

GenerateRandomMatrix

Generate an array of random number. min and max specifies the range, rows specifies the number of elements in a row, cols specifies the number of elements in a cols, decimal specifies the number of digits to be saved after decimal point.

GenerateRandomMatrix(rows, cols, min, max, decimal)

Example:

GenerateRandomMatrix(7, 3, 56, 80, 2)

Returns:

Array(3), Array(3), Array(3), Array(3), Array(3), Array(3), Array(3)

Each array is a row.

console.log(GenerateRandomMatrix(7, 3, 56, 80, 2)0)

Access the first row.

Returns:

(3) '64.75', '64.67', '64.01'

GenerateArrayByPattern

Example:

Returns:

ExportRandomRow

ExportRandomRow(length, min, max, decimal, exportType, exportPath)

Example:

Returns:

ExportRandomCol

Example:

Returns:

ExportRandomMatrix

Example:

Returns:

ExportArrayByPattern

Example:

Returns:

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago