Development Environment    

Searching in the Command History

You can search for a specified string that appears in the Command History.

After finding the string, you can copy and paste it into an M-file or other file, or you can right-click and select Evaluate Selection to run the statement containing that string.

To search for a string

  1. Select Find from the Edit menu.
  1. The Find dialog box appears. This is similar to the Find dialog box in the Command Window.

  1. Complete these steps in the Find dialog box to find all occurrences of the string you are looking for:
    1. Type the string in the Find what field.
    2. Select Command History from the Look in list box.
    3. Limit the search as needed, using Match case, Whole word, or Wrap around. These settings are remembered for your next MATLAB session.
  2. Click Previous or Next. to find the previous occurrence or the next occurrence of the string in the Command History, starting at the current cursor position.
  1. The entry containing the string is highlighted in the Command History.

    When the search reaches the bottom or top of the Command History, it beeps, but if you have Wrap around selected, it continues searching.

  1. To find the next occurrence, click Previous or Next again.

Example Using the Command History Find Dialog

This example shows the results of using find for ode.


  Copying Statements from the Command History Window Printing the Command History