fabien van mook

all packages "fvm-*"

package "fvm-optionmanip"

function file "optionsort.m"

Function copt = optionsort(copt,fopt)
         ccopt = optionsort(ccopt,fopt)

sorts the key-value pairs, input as a row cell-array copt
(in which the odd elements represent keys and must be
strings), and representing the options in an option list.

The first input argument may also be a cell-array of
cell-arrays: ccopt = { copt1, copt2, ... }; and the output
will be of the same form.

The second input argument is optional. If fopt is given,
the options in an option list are sorted according to the
order of the keys given in fopt.table(:,fopt.icol.key).
The elements k in fopt.table(k,fopt.icol.key) which hold
empty strings (and have fopt.table(k,fopt.icol.isunbound)
== 1) represent slots for keyless or unbound values in the
option list.

Keys occuring in copt but not listed
fopt.table(:,fopt.icol.key) are called unknown keys, and
they will be sorted alphabetically.

The second input argument fopt is optional. If it is not
given, all the keys occuring in copt will be sorted
alphabetically (naturally).

See the help text of m-file optioninfo.m for further
explanation.

The function internally calls the following non-standard
m-files:
-- optionformat_default.m;
-- strcmpvh.m


(c) 2026 fabien van mook

2026.08.20 release of this file within package "fvm-optionmanip" under GNU GPLv3+