You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
Syntax:
DEFAULTS('Variable',Value)
Problem:
Usually in a function call:
out = function(Var1, Var2)
if (~exist('Var1','var')
Var1 = 1234;
end
if (~exist('Var2','var')
Var2 = 3456;
end
This gets tedious after a while.
Solution using DEFAULTS
out = function(Var1, Var2)
defaults('Var1',1234,'Var2',3456);
Cite As
jl (2026). defaults.m (https://uk.mathworks.com/matlabcentral/fileexchange/47394-defaults-m), MATLAB Central File Exchange. Retrieved .
Acknowledgements
Inspired: image segmentation, edge detection with parametrique filter DKl
General Information
- Version 1.0.0.0 (1.92 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
