databank.subapply
(+databank)
Apply function to a crosslist of nested fields
Syntax
db = databank.subapply(func, db, whenMissing, level1, level2, ..., levelK)
Input arguments
func
[ function_handle ]
Function that is applied to the crosslist of fields of the input databank,
db
.
db
[ struct | Dictionary ]
Input databank, possibly nested; the function
func
is applied to the crosslist of fields ofdb
, and the resulting databank is returned.
whenMissing
[ any | @error
]
Value used to create a field if it is missing from
db
, before the functionfunc
is applied to it; ifwhenMissing=@error
, an error message is thrown.
levelK
[ string ]
List of fields at nested level K from which the crosslist will be compiled; the crosslist consists of all the combinations of the fields at
the respective nesting levels given by the lists
level1, ...,
levelK`, where K is the maximum nesting depth.
Output arguments
db
[ struct | Dictionary ]
Output databank created from the input databank by applying the function
func
to the crosslist of fields given by the listslevel1
, ...,levelK
Options
zzz=default
[ zzz | ___ ]
Description
Description
Examples