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

 채택된 답변

Roger Stafford
Roger Stafford 2014년 10월 20일
편집: Roger Stafford 2014년 10월 20일

3 개 추천

M = randi([5,18],1000);

댓글 수: 1

Hadi
Hadi 2014년 10월 20일
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?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Random Number Generation에 대해 자세히 알아보기

태그

질문:

2014년 10월 20일

댓글:

2014년 10월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by