Post Reply 
how to shuffle list / randomize list items ?
09-24-2017, 08:03 PM
Post: #1
how to shuffle list / randomize list items ?
Hello,
is there a way to shuffle / randomize list items ?
for example, I have L1:={ 2, 4, 6, 8, 10}
and I want something randomly unsorted, (with same items).

Thank you.

primer
Find all posts by this user
Quote this message in a reply
09-24-2017, 08:37 PM
Post: #2
RE: how to shuffle list / randomize list items ?
mat2list(randperm(L1)) will return a random permutation of the elements of L1.
Find all posts by this user
Quote this message in a reply
09-24-2017, 08:40 PM
Post: #3
RE: how to shuffle list / randomize list items ?
At least there is randperm which you can take as a basis für constructing your shuffled list using commands for lists.
Arno
Find all posts by this user
Quote this message in a reply
09-24-2017, 09:02 PM
Post: #4
RE: how to shuffle list / randomize list items ?
Thanks both,

Merci bcp Didier, Viele Danke Arno.

primer
Find all posts by this user
Quote this message in a reply
09-24-2017, 09:47 PM
Post: #5
RE: how to shuffle list / randomize list items ?
Pas de quoi.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)