| MATLAB® | ![]() |
As an alternative to the lookfor function, you can use the Function Browser.
lookfor topic
lookfor topic -all
lookfor topic searches for the string topic in the first comment line (the H1 line) of the help text in all M-files found on the MATLAB search path. For all files in which a match occurs, lookfor displays the H1 line.
lookfor topic -all searches the entire first comment block of an M-file looking for topic.
For example:
lookfor inverse
finds at least a dozen matches, including H1 lines containing "inverse hyperbolic cosine," "two-dimensional inverse FFT," and "pseudoinverse." Contrast this with
which inverse
or
what inverse
These functions run more quickly, but probably fail to find anything because MATLAB does not have a function inverse.
In summary, what lists the functions in a given directory, which finds the directory containing a given function or file, and lookfor finds all functions in all directories that might have something to do with a given keyword.
Even more extensive than the lookfor function are the find features in the Current Directory browser. For example, you can look for all occurrences of a specified word in all the M-files in the current directory. For more information, see Finding Files and Directories.
dir, doc, filebrowser, findstr, help, helpdesk, helpwin, regexp, what, which, who
Related topics in the MATLAB Desktop Tools and Development Environment documentation:
![]() | logspace | lower | ![]() |
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |