How do I fill a 1000*25 length vector with random, non-repetitive numbers from 1 to 1000000?
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
Fangjun Jiang
2021년 10월 4일
편집: Fangjun Jiang
2021년 10월 4일
a=zeros(1000,25);
a(:)=randperm(1000000, numel(a));
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!