function [comb4]=createcombinations(all_variabs,all_nvariabs)

% creates the 35 combinations of four variables out of 7 variables


J1=0; J2=0; J3=0; J4=0;
% select the observables
comb0 = [];
ncomb0 = [];
for i1=1:4
    J1 = J1 + 1;
    comb1(J1).var = [comb0; all_variabs(i1,:)];
    comb1(J1).nvar = [ncomb0, all_nvariabs(:,i1)];
    for i2 = i1+1:5
        J2 = J2 + 1;
        comb2(J2).var = [comb1(J1).var; all_variabs(i2,:)];
        comb2(J2).nvar = [comb1(J1).nvar, all_nvariabs(:,i2)];
            for i3 = i2+1:6
                J3 = J3 + 1;
                comb3(J3).var = [comb2(J2).var; all_variabs(i3,:)];
                comb3(J3).nvar = [comb2(J2).nvar, all_nvariabs(:,i3)];
                for i4 = i3+1:7
                    J4 = J4 + 1;
                    comb4(J4).var = [comb3(J3).var; all_variabs(i4,:)];
                    comb4(J4).nvar = [comb3(J3).nvar, all_nvariabs(:,i4)];
                end
            end
    end
%    disp(sprintf('Combination of observable %d',subset_variabs));    
end
