R = varfun(fun, T)
R = varfun(fun, T, 'InputVariables', vars)
| Parameter | Description |
|---|---|
| fun | Function handle. |
| T | Input table. |
| Parameter | Description |
|---|---|
| R | Result table, array, or cell array depending on OutputFormat. |
varfun applies a function independently to selected variables.
T = table([1; 2; 4], [10; 20; 30], 'VariableNames', {'X', 'Y'});
R = varfun(@mean, T)
| Version | Description |
|---|---|
| 2.0.0 | initial version |