| 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… |
|---|
The MATLAB workspace consists of the set of variables built up during a MATLAB session and stored in memory. You add variables to the workspace by using functions, running M-files, and loading saved workspaces.
To view the workspace and information about each variable, use the Workspace browser, or use the functions who and whos.

To delete variables from the workspace, select the variables, and then select Edit > Delete. Alternatively, use the clearvars or clear functions.
The workspace does not persist after you end the MATLAB session. To save the workspace to a file that can be read during a later MATLAB session, select File > Save, or use the save function. Saving preserves the workspace in a binary file called a MAT-file, which has a .mat extension. You can use options to save to different formats. To read in a MAT-file, select File > Import Data, or use the load function.
For More Information See MATLAB Workspace in the MATLAB Desktop Tools and Development Environment documentation and the reference pages for the who, clear, save, and load functions. |
Double-click a variable in the Workspace browser, or use openvar variablename, to see it in the Variable Editor. Use the Variable Editor to view and edit a visual representation of variables in the workspace.

For More Information See Viewing and Editing Workspace Variables with the Variable Editor in the MATLAB Desktop Tools and Development Environment documentation and the reference page for the openvar function. |
![]() | Getting Help | Managing Files in MATLAB | ![]() |

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 |