Main Content

uisave

Open dialog box for saving variables to MAT-file

Description

uisave opens a modal Save Workspace Variables dialog box. If the user clicks Save, then MATLAB® saves all variables from the user's workspace to the file displaying in the dialog box File name field.

If the named file already exists in the folder displayed at the top of the dialog box, then a confirmation dialog box opens and gives the user an opportunity to cancel the operation or overwrite the existing file.

uisave(vars) specifies which variables from the user's workspace to save.

example

uisave(vars,file) specifies the file name that appears in the File name field of the Save Workspace Variables dialog box when it opens, instead of the default, matlab.mat.

Examples

collapse all

Create three workspace variables, d, w, and y. Then, open a Save Workspace Variables dialog box with a default file, var1.mat, displaying in the File name field.

d = 'Sunday';
w = 31;
y = 2017;
uisave({'d','w'},'var1')

Save Workspace Variables dialog box. The dialog box has options to browse file locations, specify a file name and file type to save as, and buttons to save and cancel. The file name is specified as "var1.mat".

Click Save to save the workspace variables d and w to var1.mat in the folder that is displayed at the top of the dialog box.

Input Arguments

collapse all

Set of workspace variables to save in a MAT-file, specified as a character vector, cell array of character vectors, or a string array. To specify more than one variable, use a cell array of character vectors.

Example: 'y'

Example: {'x','y'}

File name that displays in the File name field when the Save Workspace Variables dialog box opens. You can omit a file extension or specify the file extension as .mat.

Example: 'data1'

Example: 'data1.mat'

Example: 'v'

More About

collapse all

Modal Dialog Box

A modal dialog box prevents a user from interacting with other MATLAB windows before responding to the dialog box.

Version History

Introduced before R2006a