# groupfilter

Filter by group

## Syntax

## Description

### Table Data

returns the rows of table or timetable `G`

= groupfilter(`T`

,`groupvars`

,`method`

)`T`

that satisfy the group-wise
filtering condition specified in `method`

. The filtering condition
`method`

is a function handle applied to each nongrouping variable.
Groups are defined by rows in the variables in `groupvars`

that have the
same unique combination of values. For example, ```
G = groupfilter(T,"Trial",@(x)
numel(x) > 5)
```

groups the data in `T`

by
`Trial`

, and keeps the rows that belong to groups with more than five
trials.

### Array Data

returns the rows of vector or matrix `B`

= groupfilter(`A`

,`groupvars`

,`method`

)`A`

that satisfy the group-wise
filtering condition specified in `method`

. The filtering condition
`method`

is a function handle applied to all column vectors. Groups are
defined by rows in the column vectors in `groupvars`

that have the same
unique combination of values.

## Examples

## Input Arguments

## Output Arguments

## Extended Capabilities

## Version History

**Introduced in R2019b**

## See Also

### Functions

`groupsummary`

|`groupcounts`

|`grouptransform`

|`findgroups`

|`splitapply`

|`discretize`

|`varfun`

|`rowfun`