File Exchange

image thumbnail


version (8.89 KB) by Nezar
Argument parsing utilities

1 Download

Updated 17 Aug 2015

From GitHub

View Version History

View license on GitHub

Useful for assigning defaults to functions that use varargin or structs of input parameters (alternative to inputParser).

See examples (and latest updates) on the github repository:

- Use ArgUtils.assignVars() to assign variables sequentially
- Use ArgUtils.assignArgs() to assign named variables: it works on either struct input or cell-array input containing a sequence of values followed by keyword arguments (name-value pairs) in any order.

Keywords are matched using MATLAB's string validator, so matching is case-insensitive and abbreviated keywords are acceptable as long as they can be matched unambiguously. There are also options to specify:
- required input parameters
- prefixes on keywords to prevent name collisions with string values

Cite As

Nezar (2021). ArgUtils (, GitHub. Retrieved .

Comments and Ratings (2)

Jeffrey Chiou

Stephen McNeill

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

Inspired: parseParameters

Community Treasure Hunt

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

Start Hunting!