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

 Respuesta aceptada

Roger Stafford
Roger Stafford el 20 de Oct. de 2014
Editada: Roger Stafford el 20 de Oct. de 2014
M = randi([5,18],1000);

1 comentario

Hadi
Hadi el 20 de Oct. de 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?

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Random Number Generation en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 20 de Oct. de 2014

Comentada:

el 20 de Oct. de 2014

Community Treasure Hunt

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

Start Hunting!

Translated by