parsed = sw_readparam(format,Name,Value)
parsed = sw_readparam(format,Name,Vale) parses name-value pair
arguments. The parsing is controlled by the given
format input. The
name-value pairs are converted into the parsed struct which has field
names identical to the given parameter names and corresponding values
taken from the input.
format can also define required dimensionality of
a given value and default values for select parameters.
sw_readparam is used in most of the method functions of spinw.
- A struct with the following fields:
fnameField names, strings in cell.
sizeRequired dimensions of the corresponding value in a cell of vectors. Negative integer means dimension has to match with any other dimension which has the identical negative integer.
defvalCell of values, provides default values for missing parameters.
softCell of logical values, optional. If
soft(i)is true, in case of missing parameter value , no warning will be given.