Desktop Tools and Development Environment Previous page   Next Page

Searching in the Command History Window

There are two types of search in the Command History window:

After finding an entry, you can copy and paste it into an M-file or any file, or you can right-click and select Evaluate Selection to run the entry.

Finding Next Entry By Letter

Type a letter in the Command History window to move to the next entry that begins with that letter, starting from the top of the Command History, as illustrated in this example:

  1. Position the cursor at which collatz in the Command History window.

    Image of Command History showing 4 entries in the first session and 2 in the second session.

  2. Type l. The Command History window selects the next entry that begins with l, in this example, load.

    Image of Command History window showing the same six entries as the previous window. This time, the load theta entry is selected because it is the next entry that begins with l.

Finding Text

Select Find from the Edit menu to search for specified text using the Find dialog box. Complete the dialog box. The search begins at the current cursor position. MATLAB finds the text you specified and highlights it. Click Find Next or Find Previous to find another occurrence, or use the keyboard shortcuts F3 and Shift+F3. Find looks for visible entries only, that is, it does not find entries in collapsed nodes.

Image of Find dialog box. The Look in field shows Command History, indicating the find operation will look through the text in the Command History.

MATLAB beeps when a search for Find Next reaches the end of the Command History window, or when a search for Find Previous reaches the top of the Command History window. If you have Wrap around selected, it continues searching after beeping.

Change the selection in the Look in field to search for the specified text in other MATLAB desktop tools.


Previous page  Using Statements from the Command History Window Printing the Command History Window Next page

© 1994-2005 The MathWorks, Inc.