View source: R/random_matrix.R
random_matrix | R Documentation |
Generate a random matrix
random_matrix(n, p, values = -9:9)
n |
The number of rows |
p |
The number of columns |
values |
A range of values from which to sample with replacement to construct the random matrix |
A n by p matrix with random values sampled with replacement from values
library(dasc2594) # simulate a random vector u <- random_matrix(3, 1) # simulate a random matrix A <- random_matrix(3, 3) # simulate a random matrix with only positive values B <- random_matrix(3, 3, values = 1:9)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.