Generate a vector like [5,4,4,3,3,3,2,2,2,2,1,1,1,1,1]
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
How can I generate a vector like [5,4,4,3,3,3,2,2,2,2,1,1,1,1,1] without a loop?
5 Commenti
Guillaume
il 20 Feb 2019
The square brackets are unnecessary.
odds = repelem(5:-1:1, 1:5)
Risposte (0)
Vedere anche
Categorie
Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!