I need to count the numbers from a vector to form a new vector, so I need to use (2, 3, 1) to get (1, 1, 2, 2, 2, 3). How do I do this?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Charlotte Mason
il 17 Lug 2017
Commentato: Charlotte Mason
il 17 Lug 2017
I have a vector which contains the values of the degrees for each node, so nodes (1, 2, 3) have degree (2, 3, 1) respectively. I want a new vector which stores the nodes as many times as the degree for that node is. So for the nodes and degrees above I will get a vector (1, 1, 2, 2, 2, 3).
0 Commenti
Risposta accettata
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Operating on Diagonal 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!