Random Vector in decreasing order
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Matt J
on 29 Aug 2022
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 Comments
More Answers (0)
See Also
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!