How do I fill a 1000*25 length vector with random, non-repetitive numbers from 1 to 1000000?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Rabeca Mohammed
el 4 de Oct. de 2021
Comentada: Rabeca Mohammed
el 5 de Oct. de 2021
I tried numerous ways of doing the above but I keep getting compatibility issues since randperm(1000000) returns a vector of length 1000000 and my created vector is just 1000*25.
0 comentarios
Respuesta aceptada
Fangjun Jiang
el 4 de Oct. de 2021
Editada: Fangjun Jiang
el 4 de Oct. de 2021
a=zeros(1000,25);
a(:)=randperm(1000000, numel(a));
Más respuestas (0)
Ver también
Categorías
Más información sobre Logical 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!