[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.

 Risposta accettata

Roger Stafford
Roger Stafford il 20 Ott 2014
Modificato: Roger Stafford il 20 Ott 2014
M = randi([5,18],1000);

1 Commento

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?

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Random Number Generation in Centro assistenza e File Exchange

Tag

Richiesto:

il 20 Ott 2014

Commentato:

il 20 Ott 2014

Community Treasure Hunt

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

Start Hunting!

Translated by