function[tb,nbComb] = combinaisons(nVar);
 
//  Enumeration de toutes les combinaisons de nVar variables 

    nbComb = 2^nVar - 1  
 
    tb = zeros(nVar,nbComb);

    for i = 1:nVar
        tb(1,i) = i;
    end;
    
    col1 = 1;
    col2 = nVar;
    k = nVar;
    
    for lg = 2:nVar
        for cl = col1:col2
            var = tb(lg-1,cl);
            if var < nVar then
                var1 = var + 1;
                for vr = var1:nVar
                    k = k + 1;
                    for l = 1:(lg-1)
                        tb(l,k) = tb(l,cl);
                    end;
                    tb(lg,k) = vr;
                end;
            end;
        end;
        col1 = col2 + 1;
        col2 = k;
    end;
                    
endfunction      
                    
