Skip to Main Content Skip to Search
Product Documentation

Command Window and Command History

Command Window

Use the Command Window to enter variables and to run MATLAB functions and scripts. MATLAB displays the results.

Press the up arrow key ↑ to recall a statement you previously typed. Edit the statement as needed, and then press Enter to run it. For more information about entering statements in the Command Window, see Controlling Command Window Input and Output.

There are other tools available to help you remember functions and their syntax, and to enter statements correctly. For example, to look for functions, use the Function Browser to look for functions—click the button at the left of the prompt to open the tool. For more information on ways to get help while you work in the Command Window, see Avoid Mistakes When Entering Code.

Command History

Statements you enter in the Command Window are logged with a timestamp in the Command History. From the Command History, you can view and search for previously run statements, as well as copy and execute selected statements. You can also create a file from selected statements.

To save the input and output from a MATLAB session to a file, use the diary function.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS