Main Content

uisave

Open dialog box for saving variables to MAT-file

Description

uisaveopens amodalSave Workspace Variables dialog box. If the user clicksSave, then MATLAB®saves all variables from the user's workspace to the file displaying in the dialog boxFile namefield.

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 theFile namefield 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, andy. Then, open a Save Workspace Variables dialog box with a default file,var1.mat, displaying in theFile namefield.

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

ClickSaveto save the workspace variablesdandwtovar1.matin 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 theFile namefield 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