Skip to content

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 of db, and the resulting databank is returned.

whenMissing [ any | @error ]

Value used to create a field if it is missing from db, before the function func is applied to it; if whenMissing=@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 atthe respective nesting levels given by the listslevel1, ...,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 lists level1, ..., levelK

Options

zzz=default [ zzz | ___ ]

Description

Description

Examples