| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
| On this page… |
|---|
Use the Command Window to enter variables and to run functions and M-file scripts.

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 Assistance While Entering Statements.
For More Information See Running Functions — Command Window and History in the MATLAB Desktop Tools and Development Environment documentation for complete details. |
Statements you enter in the Command Window are logged 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 an M-file from selected statements.

To save the input and output from a MATLAB session to a file, use the diary function.
For More Information See Using the Command History Window in the MATLAB Desktop Tools and Development Environment documentation, and the reference page for the diary function. |
![]() | Desktop Overview | Getting Help | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |