x = (0:30)/5;
K = zeros(length(x), length(x));

%idx = randperm(length(x));
%x = x(idx);

kernel_func = @(x1_,x2_) exp(-abs(x1_ - x2_));
%kernel_func = @(x1_,x2_) exp((-((x1_ - x2_)^2))/2);

for i = 1:size(K,1)
    for j = 1:size(K,2)
        K(i,j) = kernel_func(x(i), x(j));
    end
end

surf(K)

zlabel('correlation')