Array - Determine parameters (least number picked etc)
Mostrar comentarios más antiguos
Hi All, I have a couple questions for arrays I was hoping I could get help with.
I am making an array that is 2500,1 and the numbers are randomly generated
1) How do I determine the number that was drawn the least?
2) Determine how many times a range of numbers was drawn?
Thanks so much ahead of time
1 comentario
Respuestas (2)
Andrei Bobrov
el 23 de Jul. de 2013
Editada: Andrei Bobrov
el 23 de Jul. de 2013
0 votos
David Sanchez
el 23 de Jul. de 2013
%Generate integer values from the uniform distribution on the set 1:10:
r = randi(10,2500,1); % 2500 randomly distributed numbers on the range 1:10
x=1:10;
n = hist(r,x); % histogram with value distribution
[minimum_apearance index]= min(n); % index will give the numbe appearing the least
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!