Showing posts with label m-lint. Show all posts
Showing posts with label m-lint. Show all posts

Thursday, February 21, 2008

about logical indexing

Today, M-Lint was telling me that "logical indexing is usually faster than FIND".

I didn't knew what logical indexing means. a short google search and i found this out:

if you want to perform the following operation:

KdP(find( (dP> 1000) & (dP <= 2000) )) = 2;


you can optimize it just by omitting the find command just like this:
KdP( (dP> 1000) & (dP <= 2000) ) = 2;

. Matlab is just capable to handle the "logical indexing" which means the indexes of the vector that match the conditions.