Command Line Editing
Various arrow and control keys on your keyboard allow you to recall, edit, and reuse statements you have typed earlier. For example, suppose you mistakenly enter
You have misspelled
sqrt. MATLAB responds with
Instead of retyping the entire line, simply press the key. The statement you typed is redisplayed. Use the key to move the cursor over and insert the missing
r. Repeated use of the key recalls earlier lines. Typing a few characters and then the key finds a previous line that begins with those characters. You can also copy previously executed statements from the Command History. For more information, see Command History.
Following is the list of arrow and control keys you can use in the Command Window. If the preference you select for Command line key bindings is Emacs (MATLAB standard), you can also use the Ctrl+key combinations shown. See also general keyboard shortcuts for desktop tools.
||Control Key for Emacs (MATLAB standard) Preference
||Recall previous line. Works only at command line.
||Recall next line. Works only at command line if you previously used the up arrow or Ctrl+P.
||Move back one character.
||Move forward one character.
||Move right one word.
||Move left one word.
||Move to beginning of command line.
||Move to end of command line.
||Move to top of Command Window.
||Move to end of Command Window.
||Clear command line.
||Delete character at cursor in command line.
||Delete character before cursor in command line.
||Cut contents (kill) to end of command line.
||Highlight to beginning of command line.
||Highlight to end of last line. Can start at any line in the Command Window.
|Entering Long Statements||Graphics|