File Exchange

image thumbnail


version (1.94 KB) by Jared
Easy-to-use interface for supplying default values for function inputs.

1 Download

Updated 15 Jan 2013

View Version History

View License

- For input arguments x1,x2,x3, set default values x1def,x2def,x3def as a list of as parameter-value pairs using easydefaults:

- Defaults can be set for any input argument, whether it’s an explicit input or as part of a parameter-value pair:
function dummy_function(x,varargin)

- easydefaults and easyparse can in principle be used in either order, but it is usually better to parse first and fill in defaults after:
function dummy_function(x,varargin)

CAVEAT UTILITOR: this function relies on evals and assignin statements. Input checking is performed to limit potential damage, but use at your own risk.

One of a series of simple functions to provide easier input parsing within MATLAB.

Cite As

Jared (2021). easydefaults (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2011b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!