How can I generate random natural numbers between min and max range?

2 vues (au cours des 30 derniers jours)
I would like to to gererate 8 random natural numbers.
For example, if I set the range as (1, 100), then {1, 5,23, 26, 92, 12, 44, 76} would be generated.
How can I do this?

Réponse acceptée

John D'Errico
John D'Errico le 1 Avr 2020
  4 commentaires
Steven Lord
Steven Lord le 1 Avr 2020
Use randperm.
byungkeuk cho
byungkeuk cho le 1 Avr 2020
Really appreciate it.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by