Products & Services Solutions Academia Support User Community Company

Learn more about MATLAB   

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. It does not find

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

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

Find names in the current folder and subfolders that contain a specified series of characters by using the search field in the Current Folder browser. Instant search and filtering are other names for this feature.

Steps for Using the Search Field

  1. Change the current folder to the folder you want to look in.

    See Viewing and Changing the Current Folder Using the Current Folder Browser.

  2. Click the search button in the address bar.

    The path in the address bar becomes a field where you enter text, displaying the message Type search text (ex: *.m).

    (If the address bar is not in the Current Folder browser toolbar, see Using Toolbar Features.)

  3. In the search field, begin typing the string to you want to find. What you type replaces the message in the field. Ignore irrelevant characters in the string by using * (an asterisk) as the wildcard character.

    As you type, the Current Folder browser lists only the names of files and folders that include the string you typed.

    The following is an example of the results when you search for coll. The example shows results arranged by location, with the full path to the location in parenthesis.

  4. Further filter the list by typing additional characters or removing characters you already typed.

    Continuing the example, append *.m to show only file names that being with coll and have a .m extension.

  5. Customize the way search results appear by using the View menu options: Show, Sort, and Group. See Viewing Files and Folders.

  6. Clear the filter results and show all items in the current folder by clicking the Close box in the filter field. Alternatively, press the Esc key.

Advanced Search for Files — Find Files Tool

To look for a specified string in file names and within files located in multiple folders, use the Find Files tool.

Image of Find Files dialog box showing key features, and panel of results.

Steps for Using the Find Files Tool

  1. Open the Find Files tool by selecting Edit > Find Files from any desktop tool.

  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.

    Reuse a search string you previously entered in this MATLAB session by clicking the down arrow in the search field and selecting it from the list.

  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, under the More options Search type, select Contains text.

    • 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 M-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 files you want to open.

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

Accessing Previous Results

View the results of a previous search by selecting its tab at the bottom of the results pane. Find Files 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, if you want to skip them or look for them:

    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 not relevant 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.

After making the changes, when you use the Find Files tool, search ignores the selected file types.

Image of Edit Skipped File Extensions dialog box.

Locating a File or Folder in the Operating System Browser

From the Current Folder browser, you can go to a file or folder location in the Windows Explorer or the Apple Macintosh Finder:

  1. In the Current Folder browser, right-click the file or folder.

  2. From the context menu, select Locate on Disk.

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

Finding Files and Folders Using Functions

To...Use This Function
Determine if a variable, function, or folder exists.exist
Search for the specified string in the first line of M-file helplookfor
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-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS