not choosing random numbers from the range specified

2 次查看(过去 30 天)
xrange = 50:100;
a= randi(numel(xrange),10,1);
why is it not choosing from the range 50 to 100? can anyone help me?

采纳的回答

Mohammad Abouali
Mohammad Abouali 2015-1-19
Because that's not how that function is called.
If you want to randomly select 10 numbers within the range of 50 and 100 this is the command:
randi([50,100],10,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