function [P, E] = MeshGeneration1D(x_l, x_r, K)

% generates mesh for dGFEM - given 2 points, it creates mesh with given number of elements

P = linspace(x_l, x_r, K + 1);
E = zeros(2, K);
for i = 1:K
    E(1,i) = i;
    E(2,i) = i + 1;
end

end
