Arranging a vector to new index position
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposta accettata
Dyuman Joshi
il 25 Gen 2023
Spostato: Jan
il 25 Gen 2023
You mean like this
n=15;
E = randi(50,1,n)
idx = randperm(n)
Eprime = E(idx)
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!