dash.parse.nameValueOrCollection
Parse inputs that are either Name,Value pairs, or collected Name,Value pairs
Syntax
Description
Parse inputs that are either 1. A set of Name,Value inputs, or 2. A collection of Name,Value inputs in which names are organized in a string vector and values are organized in a cell vector. After parsing, returns names as a string vector and values as a cell vector.
Customize thrown error messages and IDs.
Input Arguments
varargs
cell vector
The varargin input from the calling function.
namesName
string scalar
An identifying name for the names in error messages.
valuesName
string scalar
An identifying name for the values in error messages.
extraInfo
string scalar
Additional info about Name,Value pairs for error messages.
header
string scalar
Header for thrown error IDs.
Output Arguments
names
string vector [nNames]
The names collected in a string vector
values
cell vector [nNames]
The values collected in a cell vector