timetable.rowfun
timetable: B = rowfun (func, A)
timetable: B = rowfun (func, A, Name, Value, …)
Apply a function to each row of a timetable.
B = rowfun (func, A) applies the function
handle func to each row of the timetable A and returns the
results in the timetable B, which has one row for each row of
A and carries its row times. By default the value of each
variable in the row is passed to func as a separate input
argument, and the output variables of B are named Var1,
Var2, and so on.
B = rowfun (func, A, Name, Value,
…) modifies the operation through the following
Name/Value pairs:
'InputVariables''GroupingVariables'GroupCount variable;
the row times do not, being the row times of the result. Rows with a
missing value in any grouping variable are omitted.'OutputVariableNames''NumOutputs''OutputVariableNames' if those are given,
otherwise to 1.'SeparateInputs'true (the default), the value of each
input variable is passed to func as a separate argument. When
false, the values of the row are horizontally concatenated and
passed as a single argument.'ExtractCellContents'true, the contents of cell-valued
variables are extracted before being passed to func. It defaults
to false.'OutputFormat''table' (the default, and also selected by
'auto'), which returns the results in a timetable;
'uniform', which requires func to return a scalar and
returns them in an array; or 'cell', which returns them in a
cell array.'ErrorHandler'identifier, message and
index, followed by the arguments func was called with.
Its outputs are used in place of the ones func did not return.Source Code: timetable