You are here

The Up Arrow Key

8 October, 2015 - 17:29

Suppose we want to enter the following equation:

» y=sin(45)

But we mistakenly entered

» y=sine(45)

MATLAB returns the following prompt:

??? Undefined function or method 'sine' for input arguments of type 'double'.

Instead of retyping the equation, press the up arrow key, the mistakenly entered line is displayed. Using the left arrow key, move the cursor to the misspelled letter. Make the correction and press Return or Enter to execute the command.

Pressing the up arrow key repeatedly recalls the previously entered commands. Likewise, typing the first characters of previously entered line and pressing the up arrow key displays the full command line. To execute that line, simply press the Return or Enter key.