"Francesco Perrone" <email@example.com> wrote in message news:firstname.lastname@example.org... > "Sahan " <email@example.com> wrote in message > <firstname.lastname@example.org>... >> emanuele <email@example.com> wrote in message >> <firstname.lastname@example.orgYaTP>... >> > 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.