Default arguments

Set default values for optional function input.

You are now following this Submission

Set default arguments for use in function, without having to code the switch-case blocks. Code is quite trivial, but it saves me some time coding.

Cite As

Bas-Jan (2026). Default arguments (https://se.mathworks.com/matlabcentral/fileexchange/41497-default-arguments), 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.6.0.0

Optimized code

1.4.0.0

optimized code

1.0.0.0