Improve performance, use logical indexing instead of FIND?!!
8 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Mohammed
le 22 Sep 2014
Réponse apportée : Image Analyst
le 22 Sep 2014
I was trying to improve my code but there is a message for the following code that I do not comprehend it. Any Solutions/idea/explanation?!
indices = find(NSet(:,4)~=0);
NSet = NSet(indices,[2:3, 5:clmNSet]);
Message: "To Improve performance, use logical indexing instead of FIND"
Thanks.
0 commentaires
Réponse acceptée
Image Analyst
le 22 Sep 2014
You don't need find. Use logical indexes:
logicalIndices = NSet(:,4)~=0;
NSet = NSet(logicalIndices,[2:3, 5:clmNSet]);
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Matrix Indexing 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!