databank.copy (+databank)
Copy fields of source databank to target databank
Syntax
targetDb = databank.copy(sourceDb, ...)
Input Arguments
sourceDb [ struct | Dictionary ]
Source databank from which some (or all) fields will be copied over to the
targetDb.
Options
SourceNames=@all [ @all | cellstr | string ]
List of fieldnames to be copied over from the
sourceDbto thetargetDb;@allmeans all fields existing in thesourceDbwill be copied.
TargetDb=@empty [ @empty | struct | Dictionary ]
Target databank to which some (or all) fields form the
sourceDbwill be copied over;@emptymeans a new empty databank will be created of the same type as thesourceDb(either a struct or a Dictionary).
TargetNames=@auto [ cellstr | string | function_handle ]
Names under which the fields from the
sourceDbwill be stored in thetargetDb;@automeans theTargetNameswill be simply the same as theSourceNames; ifTargetNamesis a function, the target names will be created by applying this function to each of theSourceNames.
Transform={} [ empty | function_handle | cell ]
Transformation function or functions applied to each of the fields being copied over from the
sourceDbto thetargetDb; if empty, no transformation is performed; if a cell array of functions, each function will be applied consecutively.
WhenTransformFails='Error' [ 'Error' | 'Warning' | 'Silence' ]
Action to be taken if the transformation function
Transform=evaluates to an error when applied to one or more fields of the source databank.
Output Arguments
targetDb [ struct | Dictionary ]
Target databank to which some (or all) fields from the
sourceDbwill be copied over.