Home > freetb4matlab > combinatorics > combs.m

combs

PURPOSE ^

% Function generates the nchoosek(N,K) combinations, and returns it.

SYNOPSIS ^

function L=combs(Set,K)

DESCRIPTION ^

% -*- texinfo -*-
% @deftypefn {Function File} @var{rval}= {} combs(@var{sym_set},@var{k})
% Function generates the nchoosek(N,K) combinations, and returns it.
% compute the combinations nchoosek(length(@var{sym_set}), @var{k})
% nchoosek  is a much faster variant of this function.
% @example
% @group
%
%           combs([1,2,3],2)
%           %%returns value [1 2; 1 3; 2 3]
%
%           combs(['a','e','i','o','u'],2)
%           %%returns value  [['a', 'e']; ['a', 'i']; ['a','o']; ['a','u']; ['e', 'i'];
%           %%['e','o']; ['e','u']; ['i','o']; ['i','u']; ['o', 'u'];]
%
% @end group
% @end example
% @end deftypefn
% @seealso {perms, nchoosek}

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:
Generated on Fri 22-May-2009 15:13:00 by m2html © 2003