Re: [Scilab-users] Uniform distribution of non equidistant integers

2022-08-29 Thread Samuel Gougeon
Le 29/08/2022 à 20:46, Jens Simon Strom a écrit : Hallo, to get a random number from an uniform distribution of e.g. 1, 5 and 9 I can use x=grand(1,1, "uin", 1, 3); if x==2; x=5; elseif x==3 x=9; end xI there a more straightforward way? or, faster, [1 5 9](grand(1,1,"uin",1,3))

Re: [Scilab-users] Uniform distribution of non equidistant integers

2022-08-29 Thread Samuel Gougeon
Le 29/08/2022 à 20:46, Jens Simon Strom a écrit : Hallo, to get a random number from an uniform distribution of e.g. 1, 5 and 9 I can use x=grand(1,1, "uin", 1, 3); if x==2; x=5; elseif x==3 x=9; end xI there a more straightforward way? sample(1, [1 5 9])

Re: [Scilab-users] Uniform distribution of non equidistant integers

2022-08-29 Thread Federico Miyara
Samuel, or, faster, [1 5 9](grand(1,1,"uin",1,3)) This one is absolutely brilliant! Regards, Federico Miyara -- El software de antivirus Avast ha analizado este correo electrónico en busca de virus. https://www.avast.com/antivirus ___ users

[Scilab-users] Uniform distribution of non equidistant integers

2022-08-29 Thread Jens Simon Strom
Hallo, to get a random number from an uniform distribution of e.g. 1, 5 and 9 I can use x=grand(1,1, "uin", 1, 3); if x==2; x=5; elseif x==3 x=9; end xI there a more straightforward way? Regards Jens ___ users mailing list users@lists.scilab.org