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?
1 view (last 30 days)
Show older comments
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 Comments
Accepted Answer
More Answers (0)
See Also
Categories
Find more on Operating on Diagonal Matrices 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!