Doug Hull, MathWorks
(Originally posted on Doug's MATLAB Video Tutorials blog.)
In this video a colleague was looking in a large list to see if each element was a permutation of any element of a shorter list. I name these lists Haystack and Needle so it is easy to remember which I am looking for and which I am looking through. Because we are looking for any permutation of a three character string, it might seem like we would have to search three times for each element in the needle list. It turns out, if you sort the elements of each list, the permutations are no longer an issue. The function ismember is also useful in making this string searching in MATLAB go very quickly.
Recorded: 7 Mar 2014
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .Select web site
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.