not choosing random numbers from the range specified

2 Ansichten (letzte 30 Tage)
ker fang fang
ker fang fang am 19 Jan. 2015
Kommentiert: ker fang fang am 19 Jan. 2015
xrange = 50:100;
a= randi(numel(xrange),10,1);
why is it not choosing from the range 50 to 100? can anyone help me?

Akzeptierte Antwort

Mohammad Abouali
Mohammad Abouali am 19 Jan. 2015
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)

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by