[Scilab-users] create random values between [-1,1]

Samuel Gougeon sgougeon at free.fr
Fri Jun 10 15:33:42 CEST 2016


Le 10/06/2016 15:21, Carrico, Paul a écrit :
>
> Hi
>
> In order to simulate dimensional tolerances in +/-, I’m using the 
> following workaround :
>
> n = 100;
>
> a = rand(n,1) – rand(n,1);
>
> Of course I need to increase the N value to the domain … is there a 
> more “clever” way ?
>
grand(n,1,"unf",-1,1)

BTW, i am not sure that rand(n,1)–rand(n,1) builds (or keeps) a uniform 
distribution over [-1, 1].

Samuel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20160610/1c2bac6d/attachment.htm>


More information about the users mailing list