Find Text in Command Window or History
Find Text in the Command Window
You can search for text in the Command Window, on the Command Window title bar,
click the Command Window actions button , and then select Find.
You also can use the Ctrl+F keyboard shortcut.
In the Find dialog box, enter the text that you want to search for. The search
begins at the current cursor position. To search backward or forward through the
text in the Command Window, use the and
buttons You also can use the
Shift+F3 and F3 keyboard shortcuts. To show a
list of previous searches, use the Down Arrow key.
MATLAB® finds the text you specified and highlights it.
Select a search option to change how the Command Window search for text.
Option | Description | Keyboard Shortcut |
---|---|---|
![]() | Search only for text with the precise case of the search text. | Alt+M |
![]() | Search only for exact full-word matches. | Alt+W |
![]() | Search using a regular expression. For example, to find
all the words in a file that contain the letter
To create
a capture group, surround the characters that you want to
group with parentheses. Then, to access the capture group
within the regular expression, use the format
To
create a named capture group, use the format
Multiline
search, including the use of the control characters
| Alt+X |
You can increase the amount of lines available in the Command Window so that more text is available for searching. Doing so requires more memory. On the Home tab, in the Environment section, click Settings. Select MATLAB > Command Window, and then increase the setting for Number of lines in the command window scroll buffer.
Clearing the command window (for example, with the clc
function), empties the scroll buffer. The cleared text is no longer available for
searching. To clear your display in the Command Window without clearing the buffer,
use the home
function.
Find Text in the Command History
To search for text in the Command History, use the Command History panel. To open
the panel, click the Command History icon in the sidebar. Then, use the Search field to
perform a search.
The Command History panel searches backward and selects the previous entry that contains the sequence of letters you typed. To find the previous or next occurrence of the entry, use theUp Arrow and Down Arrow keys.
To enter the selected entry into the Command Window, press Enter. To clear the search field, press Esc.
See Also
Command Window | Command History