| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
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.
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 | uisetcolor | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |