random fun.

3 visualizaciones (últimos 30 días)
huda nawaf
huda nawaf el 23 de En. de 2012
hi, is there way to chose one no. from two numbers randomly for ex. 2,3 i.e each time chose 2 or 3 randomly

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 23 de En. de 2012
round(rand+2);

Más respuestas (1)

Andrew Newell
Andrew Newell el 23 de En. de 2012
randint + 2;
or
randint(m,n) + 2;
for a matrix of random numbers.
or
R = a + randint(m,n)*(b-a);
to choose between any two integers a and b.

Categorías

Más información sobre Random Number Generation en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by