RunMat
  • Pricing
RunMat
GitHub
GitHub
Sign inTry in browser
DesktopRuntimePhysicsCADAdministrationAgent

Get RunMat updates

New releases, guides and examples.

Product+
  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download
Math+
  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting
Physics+
  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA
Industries+
  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance
Learn+
  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students
Compare+
  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons
Company+
  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms

Product

  • Runtime
  • GPU
  • Parallel
  • Compile
  • Interop and MEX
  • Simulation
  • MCAD
  • ECAD
  • Enterprise
  • AI integrations
  • Pricing
  • Download

Math

  • Signal processing
  • Linear algebra
  • Statistics
  • Curve fitting
  • Differential equations
  • Control systems
  • Optimization
  • Finance
  • Data and tables
  • Plotting

Physics

  • Simulation overview
  • Structural
  • Thermal
  • Electromagnetic
  • Joule heating
  • Thermal stress
  • Acoustics
  • Fluid flow
  • Conjugate heat transfer
  • Fluid–structure
  • What is FEA

Industries

  • Aerospace
  • Automotive and transportation
  • Defense
  • Electronics and semiconductors
  • Energy
  • Industrial machinery
  • Life sciences
  • Quantitative finance

Learn

  • Guides
  • Docs
  • Function reference
  • Language reference
  • Migration guide
  • Changelog
  • MATLAB Online
  • MATLAB AI agent
  • For students

Compare

  • RunMat vs MATLAB
  • RunMat vs Ansys
  • RunMat vs SOLIDWORKS
  • RunMat vs Altium
  • RunMat vs Cadence
  • RunMat vs COMSOL
  • RunMat vs Python
  • RunMat vs Julia
  • RunMat vs Physics AI
  • RunMat vs Octave
  • Benchmarks
  • MATLAB alternatives
  • All comparisons

Company

  • About
  • Blog
  • Contact
  • Source code↗
  • License
  • Privacy
  • Terms
GitHubXLinkedIn

© Dystr, Inc. · RunMat v0.7.1, Nov 17, 2026 ·

RunMat® is a registered trademark of Dystr, Inc. MATLAB® is a registered trademark of The MathWorks, Inc. RunMat is not affiliated with, endorsed by, or sponsored by The MathWorks, Inc.

/
See all docs
Builtin Reference
    • array2table
    • array2timetable
    • categorical
    • cell2table
    • dictionary
    • groupsummary
    • head
    • iscategorical
    • isordinal
    • istable
    • istimetable
    • ordinal
    • pivot
    • rowfilter
    • struct2table
    • table
    • table2array
    • table2cell
    • table2struct
    • table2timetable
    • timerange
    • timetable
    • timetable2table
    • uitable
    • vartype

groupsummary — Compute summary statistics by group for table or array data.

groupsummary groups table rows or array observations and computes per-group statistics. Table input returns a table; array input returns summary values and can additionally return grouping values and counts.

Syntax

G = groupsummary(T, groupvars, method, datavars)
G = groupsummary(T, groupvars, groupbins, method, datavars)
B = groupsummary(A, groupvars, method)
[B, BG, BC] = groupsummary(A, groupvars, groupbins, method)

Inputs

T
Type
Any
Required
Yes
Description
Input table.
groupvars
Type
Any
Required
Yes
Description
Grouping variable name or names.
method
Type
Any
Required
Yes
Description
Summary method name or names.
datavars
Type
Any
Required
No
Description
Data variable name or names.
groupbins
Type
Any
Required
Yes
Description
Grouping bin specification.
datavars
Type
Any
Required
No
Description
Data variable name or names, optionally followed by name-value pairs.
A
Type
Any
Required
Yes
Description
Numeric array or cell array of numeric arrays.
groupvars
Type
Any
Required
Yes
Description
Grouping array or cell array of grouping arrays.
nameValuePairs
Type
Any
Required
Variadic
Description
Grouping options such as IncludedEdge and IncludeEmptyGroups.
NameTypeRequiredDefaultDescription
TAnyYes—Input table.
groupvarsAnyYes—Grouping variable name or names.
methodAnyYes—Summary method name or names.
datavarsAnyNo—Data variable name or names.
groupbinsAnyYes—Grouping bin specification.
datavarsAnyNo—Data variable name or names, optionally followed by name-value pairs.
AAnyYes—Numeric array or cell array of numeric arrays.
groupvarsAnyYes—Grouping array or cell array of grouping arrays.
nameValuePairsAnyVariadic—Grouping options such as IncludedEdge and IncludeEmptyGroups.

Returns

G
Type
Any
Description
Grouped table summary.
B
Type
Any
Description
Summary values.
BG
Type
Any
Description
Grouping values.
BC
Type
NumericArray
Description
Group counts.
NameTypeDescription
GAnyGrouped table summary.
BAnySummary values.
BGAnyGrouping values.
BCNumericArrayGroup counts.

Returned values from groupsummary depend on how many outputs the caller requests.

Errors

RunMat:table:InvalidArgument
When
Arguments or table metadata are invalid.
Message
table: invalid argument
RunMat:table:InvalidIndex
When
Table indexing is invalid.
Message
table: invalid index
RunMat:table:InvalidVariable
When
A table variable name or value is invalid.
Message
table: invalid variable
IdentifierWhenMessage
RunMat:table:InvalidArgumentArguments or table metadata are invalid.table: invalid argument
RunMat:table:InvalidIndexTable indexing is invalid.table: invalid index
RunMat:table:InvalidVariableA table variable name or value is invalid.table: invalid variable
RunMat:readtable:IOErrorreadtable cannot open or read the requested file.readtable: file read failed
RunMat:readtable:UnsupportedFileTypereadtable receives a file type outside the text or spreadsheet import backends.readtable: unsupported file type

Table and array forms

Table forms select grouping and data variables and implement mean, sum, median, min, max, count, and numel methods.

Array forms accept numeric vectors and matrices or cell arrays of numeric arrays. Matrix columns are independent variables. [B,BG,BC] returns summary values, original-class group values when representable, and double group counts.

Integer grouping keys, integer extrema, and array/table reconstruction use typed storage. Wide integer values that cannot cross a floating-point summary boundary exactly reject instead of silently rounding.

Bins and options

One numeric grouping variable supports edge vectors and positive bin counts. IncludedEdge, IncludeMissingGroups, and a supported subset of IncludeEmptyGroups are available. Native typed-integer bin-count and zero/one controls are RunMat-only forms; scalar-double and logical controls work in MATLAB-compatible mode.

Multi-group bin specifications, time bins, additional named methods, function-handle methods, and some table selector forms are not implemented. IncludeEmptyGroups=true for categorical level expansion rejects rather than claiming to enumerate absent levels.

Execution and placement

Grouping runs on the host and is a fusion boundary. Automatic internal residency can gather before grouping; explicitly resident interactive GPU data is a mode-gated RunMat extension.

The runtime grouping keys and table schema are not statically known. Static analysis distinguishes known table input from array input but does not invent group counts, output dimensions, or a table variable schema.

Examples

Summarize an array and return groups

[B,BG,BC] = groupsummary([10;20;30],[1;1;2],'mean');

Preserve wide integer groups

base = uint64(9007199254740992); [B,BG] = groupsummary([base+3;base+1;base+4],[base;base+1;base],'max');

Using groupsummary with coding agents

Open a RunMat example with live inputs, then ask the agent to explain how groupsummary changes the result.

Run a small groupsummary example, explain the result, then change one input and compare the output.

Related Table functions

Table

array2table · array2timetable · categorical · cell2table · dictionary · head · iscategorical · isordinal · istable · istimetable · ordinal · pivot · rowfilter · struct2table · table · table2array · table2cell · table2struct · table2timetable · timerange · timetable · timetable2table · uitable · vartype

Indexing

dictionary.subsasgn · dictionary.subsref · table.subsasgn · table.subsref

Source you can read

Every RunMat function's source is public. Read exactly how groupsummary is executed, line by line, in Rust.

  • View the source for groupsummary in Rust on GitHub
  • Learn how the RunMat runtime works
  • Found a bug? Open an issue with a minimal reproduction.

About RunMat

RunMat is a runtime that executes MATLAB-syntax code fast on any GPU. The runtime is free for individuals, including freelancers; students and faculty at an academic institution, for teaching or research there; contributors to an open-source project, for work on that project; organizations with 250 or fewer people and US$10M or less in annual revenue; and anyone, for non-production use. See runmat.com/license.

  • RunMat automatically optimizes your math for GPU execution on Apple, Nvidia, and AMD hardware. No code changes needed. Simulations that took hours now take minutes.
  • Start running code in seconds. RunMat runs in the browser, on the desktop, or from the CLI. No license server, no IT ticket.

Getting started · Benchmarks · Pricing

Download RunMat

Download RunMat for full performance, or use RunMat in your browser for zero setup.

Download RunMatOpen Sandbox
On this page
  • Syntax
  • Inputs
  • Returns
  • Errors
  • Table and array forms
  • Bins and options
  • Execution and placement
  • Examples
  • Summarize an array and return groups
  • Preserve wide integer groups
  • Using groupsummary with coding agents
  • Related Table functions
  • Table
  • Indexing
  • Source you can read
  • About RunMat