Skip to content

pivot

table · scripts/table/pivot.m

PIVOT  Reshape a table into a pivot (crosstab) table (MATLAB compat).

  P = PIVOT (T, 'Rows', R, 'Columns', C) returns a table whose first
  variable holds the unique values of variable R and whose remaining
  variables (one per unique value of variable C) hold the count of rows
  in each (R, C) cell.

  P = PIVOT (..., 'Values', V, 'Method', M) aggregates variable V within
  each cell using method M ('sum' (default when Values given), 'mean',
  'max', 'min', 'count', or a function handle).