Apply default values to current workspace

Assigns default values to variables in workspace that are empty or undefined

You are now following this Submission

If a variable <default_foo> exists in a workspace, and the variable <foo> is undefined or empty, <foo> is assigned the value of <default_foo>
This function makes it easy to assign default values in other functions without the ~exists || isempty syntax.

Cite As

Isaac Pedisich (2026). Apply default values to current workspace (https://www.mathworks.com/matlabcentral/fileexchange/55072-apply-default-values-to-current-workspace), 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.1.0.0

updated name
Forgot to include my own function in the example

1.0.0.0

small typo