a=1;
b=1;
c=1;
dx=1;

A=[1 0 0 0 0; -0.5 1 -0.5 0 0; 0 -0.5 1 -0.5 0; ...
    0 0 -0.5 1 -0.5; 0 0 0 -b/dx a+b*dx];
D = [0 -0.1 -0.1 -0.1 c];
U = inv(A)*D'
plot(U)
xlabel('x')
ylabel('u')

    
    




