Save All Variables In Base Workspace Except Those Specified

The user passes the function the a list of variables NOT to save, the path of where to save, and the name of the file to save.

You are now following this Submission

Purpose:
This function saves all the variables in the base workspace except those in a given list of variables
Input Variables:
  • vargin1 = except_variables
  • vargin2 = databases_directory1
  • vargin3 = database_filename_SAE
Variable definition:
except_variables = the variable that has all the variables not to save.
  • variables must be separated by either empty space (blanks), commas, and/or semi- colons
  • the series of variables must begin with a single quotation mark and end with a single quotation mark
  • Example: except_variables = 'i_dont_want_this_variable1 i_dont_want_this_variable2;i_dont_want_this_variable3 i_dont_want_this_variable4, i_dont_want_this_variable5'
databases_directory1 = the path where to save the workspace variables.
  • Last character in path must be a backslash
  • Example: databases_directory1 = 'C:\MATLAB Files\Databases\'
database_filename_SAE = the filename of the .mat file (including the .mat extension) of all the saved workspace variables
  • extension must be .mat
  • saves files with the .mat version (type) of "-v7.3". User can manually change this in the code below if desired.
  • Example: database_filename_SAE = 'Test Workspace DATABASE.mat'

Cite As

Jared (2026). Save All Variables In Base Workspace Except Those Specified (https://se.mathworks.com/matlabcentral/fileexchange/162606-save-all-variables-in-base-workspace-except-those-specified), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0