Azzera filtri
Azzera filtri

Improve performance, use logical indexing instead of FIND?!!

14 visualizzazioni (ultimi 30 giorni)
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.

Risposta accettata

Image Analyst
Image Analyst il 22 Set 2014
You don't need find. Use logical indexes:
logicalIndices = NSet(:,4)~=0;
NSet = NSet(logicalIndices,[2:3, 5:clmNSet]);

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices 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!

Translated by