uisave - Open dialog box for saving variables to MAT-file - MATLAB (original) (raw)
Main Content
Open dialog box for saving variables to MAT-file
Syntax
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](#d126e1945048))
specifies which variables from the user's workspace to save.
uisave([vars](#d126e1945048),[file](#d126e1945078))
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
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')
Click Save to save the workspace variablesd
and w
tovar1.mat
in the folder that is displayed at the top of the dialog box.
Input Arguments
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
A modal dialog box prevents a user from interacting with other MATLAB windows before responding to the dialog box.
Version History
Introduced before R2006a