[Matlab]Desperate help with a simple code.

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

Accepted Answer

Roger Stafford
Roger Stafford on 20 Oct 2014
Edited: Roger Stafford on 20 Oct 2014
M = randi([5,18],1000);
  1 Comment
Hadi
Hadi on 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?

Sign in to comment.

More Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!