How to generate a no. of permutations(lets say 100) of a particular row of a matrix(consisting of 30 coloumns) and store the generated permutation into another array row wise??
이전 댓글 표시
Basically I am trying to generate population for my chromosome in genetic algorithm. I have made an array of 30 elements and now to generate the population, I have to permutate the elements of the array and store these permutations in form of a matrix row wise.Now can I do this using permute and other permutation functions in matlab or will I have to make a different method to generate this.Any reference codes shall be very helpful.
채택된 답변
추가 답변 (1개)
Image Analyst
2015년 4월 4일
편집: Image Analyst
2015년 4월 4일
Try randperm() or randi().
newSortingOrder = randperm(30);
카테고리
도움말 센터 및 File Exchange에서 Random Number Generation에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!