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.
Isaac Pedisich (2021). Apply default values to current workspace (https://www.mathworks.com/matlabcentral/fileexchange/55072-apply-default-values-to-current-workspace), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!Create scripts with code, output, and formatted text in a single executable document.
@Chang hsiung: Sorry - I had a typo where I was applying defaults ironically enough. The issue has been fixed.
the example you included seemed not working properly ???