pracma (version 1.9.9)

combs: Generate Combinations

Description

Generates all combinations of length m of a vector a.

Usage

combs(a, m)

Arguments

a
numeric vector of some length n
m
integer with 0 <= m="" <="n

Value

matrix representing combinations of the elements of a

Details

combs generates combinations of length n of the elements of the vector a.

See Also

perms, randcomb

Examples

Run this code
combs(seq(2, 10, by=2), m = 3)

Run the code above in your browser using DataLab