lundi 29 décembre 2014

How to select random numbers from a given list in matlab / octave

How to select random numbers from a given list of data


I can create a list of 5 random numbers between 50 and 100 using the code below but how can I have it randomly select numbers from a dataset of values example dataset=[10;20;25;111;14];



amtofNumbers=5; %amount of numbers
a = 50;
b = 100;
r = (b-a).*rand(amtofNumbers,1) + a


I'm using octave 3.8.1 which works with matlab .





Aucun commentaire:

Enregistrer un commentaire