random fun.

Asked by huda nawaf on 23 Jan 2012
Latest activity Answered by Andrew Newell on 23 Jan 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

0 Comments

huda nawaf

Tags

Products

No products are associated with this question.

2 Answers

Answer by Sean de Wolski on 23 Jan 2012
Accepted answer
round(rand+2);

0 Comments

Sean de Wolski
Answer by Andrew Newell on 23 Jan 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.

0 Comments

Andrew Newell

Contact us