How i can insert a random integer between two numbers?

I have a variable and i want it to take a randome integer between numbers 2 and 101

답변 (2개)

Star Strider
Star Strider 2015년 4월 22일
The randi function is perfect for this:
rv = randi([2 101]);

카테고리

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

질문:

2015년 4월 22일

답변:

2015년 4월 22일

Community Treasure Hunt

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

Start Hunting!

Translated by