Chose a random integer between an upper and lower limit.

3 次查看(过去 30 天)
I ask the user to input two limits a upper and lower limit. I then want to generate a random integer between these two values.
I tried using for example:
a = input('enter a'); %lower
b = input('enter b'); %upper
c = randi(b,a)
Although this seems to create a vector I just want a scalar?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2014-5-1
编辑:Azzi Abdelmalek 2014-5-1

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Mathematics 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by