Desktop Tools and Development Environment Previous page   Next Page

Loading a Saved Workspace and Importing Data

To load saved variables into the workspace,

  1. Click the Import Data button on the toolbar in the Workspace browser.
  1. The Open dialog box opens.

  1. Select the MAT-file you want to load and click Open.
  1. The variables and their values, as stored in the MAT-file, are loaded into the current workspace. If any variables being loaded have the same names as variables in the current workspace, the values from the MAT-file replace the values in the current workspace. Any variables in the MAT-file that are not in the workspace are added to the workspace.

Function Alternative

Use load to open a saved workspace. For example,

load('june10')

loads all workspace variables from the file june10.mat.

Importing Data

MATLAB provides other methods and functions for loading information. You can use one of these methods, the Import Wizard, from the Workspace browser--select Edit -> Paste Special or use Ctrl+V to import data to MATLAB using the Import Wizard. For more information on the Import Wizard and other methods for loading information, see the Import Wizard documentation.

Viewing Variables in MAT-Files

Use the Current Directory browser to view the contents of a MAT-file without loading the file into MATLAB. For details, see Finding Files and Content Within Files.

Function Alternative.   Use whos with the -file option.


Previous page  Saving the Current Workspace Changing and Copying Variable Names Next page

© 1994-2005 The MathWorks, Inc.