Desktop Tools and Development Environment |
Searching in the Command Window
You can search for specified text that appears in the Command Window, where the text was either part of input you supplied, or output displayed by MATLAB. There are two search features for the Command Window:
After finding the text, you can copy and paste it to the prompt in the Command Window to run it, or into an M-file or other file.
See also Recalling Previous Lines, Tab Completion, and Keyboard Shortcuts in the Command Window for techniques to reuse previous statements and navigate in the Command Window.
Find Dialog Box
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.
MATLAB beeps when a search for Find Next reaches the end of the Command Window, or when a search for Find Previous reaches the top of the Command Window. If you have Wrap around selected, it continues searching after beeping.
Note that you can only search for text currently displayed in the Command Window. To increase the amount of information maintained in the Command Window, increase the setting for the command session scroll buffer size in Command Window preferences, and do not clear the Command Window.
Change the selection in the Look in field to search for the specified text in other MATLAB desktop tools.
With the incremental search feature, the cursor moves to the next or previous occurrence of the specified text in the Command Window. It is similar to the Emacs search feature. To use the incremental search feature in the Command Window,
An incremental search field, Inc Search, appears at the bottom of the Command Window and is preceded by F for a forward search, or R when you are looking for the previous occurrence (reverse search).
b
, the first occurrence of that letter in the Command Window after the current cursor position is highlighted. For the example shown, the first occurrence of b
is highlighted, the b
in Berlin
. Note that incremental search allows for case sensitivity--see Case Sensitivity in Incremental Search.
When you type the next letter, the first occurrence of the text becomes highlighted. In the example, when you add the letter o
to the b
so that the Inc Search field now has bo
, the bo
in Boston
becomes highlighted.
Boston
in the Command Window, press Ctrl+S. To find the previous occurrence of the text, press Ctrl+R.
Incremental search is also available in the Editor/Debugger--see Incremental Search.
Case Sensitivity in Incremental Search
When you enter lowercase letters in the Inc Search field, for example, b
, incremental search looks for both lowercase and uppercase instances of the letters, for example b
and B
. However, if you enter uppercase letters, for example, B
, incremental search only looks for instances that match the case you entered.
In the example, enter bO
in the Inc Search field and incremental search does not find any matching text.
Keeping a Session Log | Preferences for the Command Window |
© 1994-2005 The MathWorks, Inc.