File Exchange

image thumbnail

Apply default values to current workspace

version (2.11 KB) by Isaac Pedisich
Assigns default values to variables in workspace that are empty or undefined

1 Download

Updated 25 Jan 2016

View Version History

View License

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 (2021). Apply default values to current workspace (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (2)

Isaac Pedisich

@Chang hsiung: Sorry - I had a typo where I was applying defaults ironically enough. The issue has been fixed.

Chang hsiung

the example you included seemed not working properly ???

MATLAB Release Compatibility
Created with R2014a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!