"Francesco Perrone" <firstname.lastname@example.org> wrote in message news:email@example.com... > "Sahan " <firstname.lastname@example.org> wrote in message > <email@example.com>... >> emanuele <firstname.lastname@example.org> wrote in message >> <email@example.comYaTP>... >> > Hi all >> > how can generate random integer numbers? >> > Thanks in advantage Emanuele >> >> >> Well, you can use randint function eg: to get uniform random integer >> vector of (1x10) with random number 1 to 1000 >> >> test = randint(1,10,[1 1000]) > > I would use randi function.
If the numbers need to be generated with replacement from the discrete uniform distribution on integer values, use RANDI. If they need to be generated without replacement from the discrete uniform distribution, use RANDPERM. If they need to be generated with a nonuniform distribution, things get more tricky.