I need to search a large set of matlab (.m) files, and I can't find a way to do it in Google Desktop. I haven't seen any source code indexer that supports matlab either.
What options do I have?
I need to search a large set of matlab (.m) files, and I can't find a way to do it in Google Desktop. I haven't seen any source code indexer that supports matlab either.
What options do I have?
Grep would be a good tool:
$ grep pattern path
or
$ grep pattern -ri path
for a case insensitive, recursive search
I would suggest checking out a submission from Urs Schwarz on The MathWorks File Exchange:
This should allow you to search through a series of files or folders from within MATLAB.
Previous answer:
If you are simply trying to locate m-files, but not search within them, then the following may help...
Assuming all of the m-files you want to search through are on the MATLAB path (which they would pretty much have to be if you actually want to run them in MATLAB), then you can use the WHICH function to find where they are located.
For example, if I wanted to find all the overloaded functions with the name "display", I could do this:
>> which display -all
built-in (C:\Program Files\MATLAB\R2009a\toolbox\matlab\lang\@cell\display) % cell method
built-in (C:\Program Files\MATLAB\R2009a\toolbox\matlab\lang\@double\display) % double method
built-in (C:\Program Files\MATLAB\R2009a\toolbox\matlab\lang\@logical\display) % logical method
built-in (C:\Program Files\MATLAB\R2009a\toolbox\matlab\lang\@char\display)
...
You can also use the functional form of WHICH to collect the file paths in a cell array:
filePaths = which('display','-all');
You can use Larry's Any Text File Indexer to get Google Desktop to index MATLAB files. Just install the plug-in and specify ".m" as the extension of interest.