Arranging a vector to new index position
1 view (last 30 days)
Show older comments
I have a vector E= [E1, E2.... En]. I have shuffled it's index with randomperm. I want to arrange the vector E according to new index.
0 Comments
Accepted Answer
Dyuman Joshi
on 25 Jan 2023
Moved: Jan
on 25 Jan 2023
You mean like this
n=15;
E = randi(50,1,n)
idx = randperm(n)
Eprime = E(idx)
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays 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!