mercredi 28 octobre 2020

How can I obtain a random number for each column in a matrix?

I have a matrix with n columns and 2 rows. But for each column I would like to pick a random number. I have been searching about this but I´ve gotten nothing. At this point I am using very small matrices but my code will be applied to big matrices.

I have this matrix, (more columns will be added)

          [,1]     [,2]
fcMax 2.391416 1.390129
fcMin 2.316555 1.374918

and I want to obtain a vector with dim = n (in this case 2, the number of columns), which is constructed by choosing a random number for each column.




Aucun commentaire:

Enregistrer un commentaire