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

Jens Simon Strom j.s.strom at hslmg.de
Fri Jun 10 15:59:33 CEST 2016


rand(n,1)--rand(n,1) is definitely  NOT uniform.
Jens
------------------------------------------------------------------------------
Am 10.06.2016 15:33, schrieb Samuel Gougeon:
> 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
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users

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


More information about the users mailing list