Get from Ico-github-logo

Highlights from

  • ArgUtils.assignArgs( defa...
    ASSIGNARGS Assign input and default values to named target variables
  • ArgUtils.assignVars( defa...
    ASSIGNVARS Assign input and default values to a sequence of target variables
  • ArgUtils.tostruct(varargin)
    Because MATLAB's struct API is a disaster
  • ArgUtils.unstruct(s)
    Unpack a struct into a cell-array of name-value pairs.
  • nameDoesMatch(name, list)
  • startsWith(str, prefix)
  • stripPrefix(str, prefix)
  • test()
    string matching is case-insensitive, allows abbreviation
  • updateFieldValues(default...
    'assigned' is a reference to a java hash set
  • ArgUtils.ArgUtils
  • View all files
4.5 | 2 ratings Rate this file 1 Download (last 30 days) File Size: 313 KB File ID: #42205 Version: 1.5



Nezar (view profile)


12 Jun 2013 (Updated )

Argument parsing utilities

| Watch this File

File Information

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


This file inspired Parse Parameters.

Required Products MATLAB
MATLAB release MATLAB 8.0 (R2012b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (2)
12 Jul 2015 Jeffrey Chiou  
12 Jun 2013 Stephen McNeill  
17 Jun 2013 1.1

version 1.0 - stable

18 Jun 2013 1.2

version 1.1 - fixed minor bug with prefixes, moved nonpublic functions to private folder

24 Jun 2013 1.4

name on license

17 Aug 2015 1.5

Connected to github

Contact us