function z = gmm2d(x1, x2, dimensions, mixChecked, weights, means2d, variances2d, allvariances, ratio) %parameter fkt beschreibung 3d array
     
    s = length(x1);
    t = length(x2);
    z = zeros(t, s);
    M = length(means2d); 
    
        
        for i = 1:s
            for j = 1:t
                x2d = [x1(i); x2(j)];
                for m = 1:M 
                    if(mixChecked(m) == 1)
                        C = 1 / sqrt((2*pi)^dimensions*prod(allvariances(m, :)));% display('C'); C
                        S = inv(variances2d(:,:,m));  %display('S'); S
                        g = weights(m).* C * exp(-0.5 * (x2d-means2d(:,:,m))' * S * (x2d-means2d(:,:,m)));
                        z(j, i) = z(j, i) + g; 
                    end
                end
            end    
        end
        
end
    


