timetable.varfun
timetable: B = varfun (func, A)
timetable: B = varfun (func, A, Name, Value, …)
Apply a function to each variable of a timetable.
B = varfun (func, A) applies the function
handle func separately to each variable of the timetable A
and returns the results in the timetable B. Each variable is
passed whole, so a function that reduces a column to a scalar gives a
one-row result. The output variables are named for the function and
the variable they came from, as in mean_Speed, and every row of
the result carries the row time of the first row it was computed from.
B = varfun (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.'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