Navigation

Operators and Keywords

Function List:

C++ API

: [reg, prop] = parseparams (params)
: [reg, var1, …] = parseparams (params, name1, default1, …)

Return in reg the cell elements of param up to the first string element and in prop all remaining elements beginning with the first string element.

For example:

[reg, prop] = parseparams ({1, 2, "linewidth", 10})
reg =
{
  [1,1] = 1
  [1,2] = 2
}
prop =
{
  [1,1] = linewidth
  [1,2] = 10
}

The parseparams function may be used to separate regular numeric arguments from additional arguments given as property/value pairs of the varargin cell array.

In the second form of the call, available options are specified directly with their default values given as name-value pairs. If params do not form name-value pairs, or if an option occurs that does not match any of the available options, an error occurs.

When called from an m-file function, the error is prefixed with the name of the caller function.

The matching of options is case-insensitive.

See also: varargin, inputParser.

Package: octave