| MATLAB Function Reference | ![]() |
uisave
uisave(variables)
uisave(variables,filename)
uisave displays the Save Workspace Variables dialog box for saving workspace variables to a MAT-file, as shown in the figure below. By default, the dialog box opens in your current directory.

Note The uisave dialog box is modal. A modal dialog box prevents the user from interacting with other windows before responding. For more information, see WindowStyle in the MATLAB Figure Properties. |
If you type a name in the File name field, such as my_vars, and click Save, the dialog saves all workspace variables in the file my_vars.mat. The default filename is matlab.mat.
uisave(variables) saves only the variables listed in variables. For a single variable, variables can be a string. For more than one variable, variables must be a cell array of strings.
uisave(variables,filename) uses the specified filename as the default File name in the Save Workspace Variables dialog box.
Note uisave cannot be compiled. If you want to create a dialog that can be compiled, use uiputfile. |
This example creates workspace variables h and g, and then displays the Save Workspace Variables dialog box in the current directory with the default File name set to var1.
h = 365;
g = 52;
uisave({'h','g'},'var1');

Clicking Save stores the workspace variables h and g in the file var1.mat in the displayed directory.
![]() | uiresume, uiwait | uisetcolor | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |