combsFS

combsFS is an iterative algorithm equivalent to the MATLAB combs.m

Syntax

Description

example

P =combsFS(v, m) combsFS used to generate all possible combinations of size 3 of elements 5, 8, 9, 10, 11.

Examples

expand all

  • combsFS used to generate all possible combinations of size 3 of elements 5, 8, 9, 10, 11.
  • combsFS([5 8:11],3)
    ans =
    
      10×3 int8 matrix
    
        5    8    9
        5    8   10
        5    8   11
        5    9   10
        5    9   11
        5   10   11
        8    9   10
        8    9   11
        8   10   11
        9   10   11
    
    

    Input Arguments

    expand all

    v — A vector with n elements. It contains the response variable.

    It can be either a row or a column vector.

    Data Types: single|double

    m — Scalar. It specifies the size of the combinations.

    Data Types: single|double

    Output Arguments

    expand all

    P —m-combinations without repetition taken in lexicographic order from the vector v. Matrix containing the m-combinations in the rows

    Data Types - single|double

    References

    Knuth, D. E. (1997). "The Art of Computer Programming", Volume 1: Fundamental Algorithms, Third ed. Addison-Wesley. [pp. 52--74].

    See Also

    This page has been automatically generated by our routine publishFS