[Matlab]Desperate help with a simple code.

How Can I generate 1,000,000 random integers with range of [5 -----> 18] in a square matrix using the randi fucntion? Thank you.

 Réponse acceptée

Roger Stafford
Roger Stafford le 20 Oct 2014
Modifié(e) : Roger Stafford le 20 Oct 2014
M = randi([5,18],1000);

1 commentaire

Hadi
Hadi le 20 Oct 2014
Thank you so much. Can I ask you one more question? How about finding the probability of a certain number and a range of certain numbers at M?

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Random Number Generation dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by