random permutation with repetition for > 2000 elements

2 visualizaciones (últimos 30 días)
Claudia
Claudia el 1 de Dic. de 2013
Editada: Claudia el 1 de Dic. de 2013
Hi
randperm is for permutations WITHOUT repetition. I would need it WITH repetition. I could calculate all permutations (I found some scripts), but I need it for vectors with more than 2000 elements. Any ideas?
Thanks so much
Claudia

Respuesta aceptada

Image Analyst
Image Analyst el 1 de Dic. de 2013
Try this
randomNumbers = randi(highestNumber, rows, columns);
plug in whatever values you want, for example:
randomNumbers = randi(9, 1, 2000); % 2000 numbers in the range 1-9.
  1 comentario
Claudia
Claudia el 1 de Dic. de 2013
Editada: Claudia el 1 de Dic. de 2013
Perfect! I have seen randi but must have been 'blind' as I did not realize that this is exactly what I am looking for. Thanks so much for your fast help! Cheers

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Elementary Math en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by