Skip to Main Content Skip to Search
Product Documentation

Finding Files and Folders

Finding Files and Folders by Name in the Current Folder

In the Current Folder browser, use the typeahead feature to find a file or folder by name in the current folder:

  1. Position the pointer in the list of files and folders in the current folder.

  2. Type the first characters of the name you want to find.

    As you type, the Current Folder browser searches downward from the top of the window, looking through all expanded folders. It selects the first entry in the current folder whose name begins with the characters you typed.

Typeahead and find as you type are other names for this feature.

Simple Search for File and Folder Names in the Current Folder Browser

To search for names that contain a specified series of characters in the current folder and subfolders:

  1. In the Current Folder field, change the current folder to be the one you want to search.

  2. Click the search button in the address bar.

  3. Type the absolute path name or begin typing a file name. The asterisk character (*) is a wildcard.

    If you type a partial path name, such as matlab\toolbox, MATLAB regards it as a file name.

  4. Press Enter:

    • If you typed a path name, that path becomes the current folder.

    • If you typed a file name, MATLAB displays all files within the current folder (including its subfolders) that match that file name.

  5. Continue filtering the list by doing either of the following:

    • Typing additional characters

    • Removing characters you already typed

    For example, to shows only file names that begin with coll and have a .m extension, type coll*.m

  6. Clear the results and show all items in the current folder by pressing the Esc key.

Instant search and filtering are other names for this feature.

Advanced Search for Files — Find Files Tool

To look for a specified string in file names and within files located in multiple folders, select Edit > Find Files, which opens the Find Files tool. The following sections provide details on using the tool.

Steps for Using the Find Files Tool

  1. Open the Find Files tool by selecting Edit > Find Files.

  2. Search for file names containing a specified string by typing the string in the Find files named field.

    Ignore irrelevant characters in the string by using an asterisk (*) as the wildcard character. For example, type coll* to search for file names that start with coll.

  3. Search for a specified string in the content of files by typing the string in the Find files containing text field.

    For example, search for plot. Alternatively, select text in the Command Window or Editor and that text appears in the field.

    • For partial word searching in file contents, select Contains text under the More options Search type.

    • Find an exact full-string match by selecting Matches whole word.

  4. Specify file types to search for by selecting one of the options listed in the table.

    One type

    For Include only file type(s), select the file type you are looking for.

    For example, select *.m to limit the search to MATLAB program files.

    All types
    1. For Include only file type(s), select All files (*).

    2. Clear the Skip file type(s) check box, under More options.

    Other variations
    1. For Include only file type(s), select All files (*).

    2. Select the Skip file type(s) check box, under More options.

    3. Select Edit to specify the file types.

      See Skipping File Types.

  5. Specify the folders to search, using one of the Look in options:

    • Select an option listed.

    • Enter the full path for one or more folders. Separate each path by a semicolon (;).

    • Include subfolders by selecting the Include subdirectories check box.

  6. Further restrict the search using More options. For example, use the Skip files over option. It ignores large files that could take a long time to look through.

  7. Perform the search by clicking Find.

    The Find Files tool presents the search results in the right pane of the dialog box, with a summary at the bottom. For text searches, results include the line number and line of code.

  8. Customize the display of results:

    • To see file locations, select Show full pathnames.

    • To sort results by a column, click the column heading. For example, click Line to sort results by line number.

Opening Files from the Results List

  1. Select the file to open. To select multiple files:

    • Click to the left of an icon and drag up or down to select contiguous items

    • Shift+click to select contiguous items

    • Ctrl+click to select non-contiguous items

  2. Right-click and select one of the Open options from the context menu.

    For details about the Open options, see Opening and Running Files.

Accessing Previous Results

View the results of a previous search by selecting its tab at the bottom of the results pane. The Find Files tool shows up to 10 tabs for previous search results while the tool is open. File Files does not maintain the results after you close the tool.

Skipping File Types

Use the Find Files tool to look in all file types except file types you specify:

  1. For Include only file type(s), select All files (*).

  2. Specify the file types you want the search to ignore:

    1. Select the Skip file type(s) check box.

    2. Click Edit.

  3. In the resulting Edit Skipped File Extension dialog box, specify which file types to look in and which to ignore:

    • Ignore a file type by selecting its State check box.

    • Look for a file type by clearing its State check box.

  4. Add any file types not listed that you want to skip or look for:

    1. Enter the file extension in the field at the top of the dialog box.

    2. Click Add.

      The file type appears in the list.

    3. Verify that the State check box has the setting you want.

    The example at the end of this procedure shows the scc file type added.

  5. Reduce the size of the list by removing any file extensions irrelevant to your search:

    1. Select the name of the extension.

    2. Click Remove.

  6. Click OK to accept your changes.

    The Edit Skipped File Extensions dialog box closes.

When you use the Find Files tool, search ignores the selected file types after making the changes.

Image of Edit Skipped File Extensions dialog box.

Locating a File or Folder in the Operating System Browser

To go to a file or folder location in Windows Explorer or Apple Mac Finder, do one of the following:

The Windows Explorer or Mac Finder opens to the folder containing the selected item.

Finding Files and Folders Using Functions

To...Use This Function
List files and folders in the current folder or in subfolders on the search pathdir
Determine if a variable, function, or folder exists.exist
Search for the specified string in the first line of help in a MATLAB program filelookfor
See files and folders that are relevant to MATLABwhat
See the full path to a filewhich

Additional Ways to Find Files

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS