Random selection

Carrico, Paul paul.carrico at esterline.com
Fri Dec 10 10:27:56 CET 2010


Dear all,
 
This is a strange idea (but usefull one) : I've a list a X point and I
would like to select 3 of them in a random way (of course a point can be
choose only ounce)  
 
I can use the following code 
round(X*rand(1,3))
 
neverthless :
- I've to loop until the 3 integer are different
- if X becomes small it's diffucult to have 3 different values
 
I'm sure these a simplier way to generate these 3 integers ... can I
have an advice ?
 
Thanks
 
Paul

--------------------------------------------------------------------------------


Le présent mail et ses pièces jointes sont confidentiels et destinés à la personne ou aux personnes visée(s) ci-dessus. Si vous avez reçu cet e-mail par erreur, veuillez contacter immédiatement l'expéditeur et effacer le message de votre système. Toute divulgation, copie ou distribution de cet e-mail est strictement interdite.

This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please contact the sender and delete the email from your system. If you are not the named addressee you should not disseminate, distribute or copy this email.

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


More information about the users mailing list