Random Vector in decreasing order
조회 수: 2 (최근 30일)
이전 댓글 표시
I want to create the random column vector with 15 elements, they should be listed in decreased order.
I can create a random clumn vector and then I can sort it in decreased order but is it possible to create it sorted.
댓글 수: 0
채택된 답변
Matt J
2022년 8월 29일
There are alternatives to post-sorting, e.g. below, but no randomization function that will just spit out a sorted list.
cumsum(rand(15,1),'reverse')
댓글 수: 0
추가 답변 (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!