Creating a Vector with specified entries
4 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hey guys,
I'd like to create a vector that goes from 1 to n that looks like this:
[1 1 2 2 3 3 ... n n]
Any ideas?
KD
0 Commenti
Risposta accettata
per isakson
il 8 Ago 2013
This is better
n = 12;
num = repmat( [1:n], 2, 1 );
num = transpose( num(:) )
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Matrix Indexing 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!