Sorting matrix while removing zero values and keeping track of index at the same time.
7 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
CalebJones
le 11 Fév 2020
Réponse apportée : CalebJones
le 11 Fév 2020
This is after sorting but with zero values as well.
[a,ind] = sort(totalAmplitude);
bb = [a;ind]';
I want to eliminate the zero values along with its index value as well.
I tried this but this is messing up my original index as well. The index very much needed for me.
[total_amp_temp,index] = sort(nonzeros(totalAmplitude));
ccd = [total_amp_temp index];
I have attached MATFILE as well.
0 commentaires
Réponse acceptée
Plus de réponses (1)
Voir également
Catégories
En savoir plus sur Structures dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!