clear all
close all

% where we solve
a = 
b =

% grid
n = 
h = (b-a)/n;
x = a:h:b;
y = zeros(1,n+1);

% define the system of linear equations (3-diagonal matrix):
% initialization of the system of linear equations
lower = zeros(1,n+1); % lower diagonal
diag = zeros(1,n+1); % diagonal
upper = zeros(1,n+1); % upper diagonal
rhs = zeros(1,n+1); % right hand side

% define the first equation (BC)
diag(1) =
upper(1) = 
rhs(1) = 
% define equations in the middle
for i = 2:n
    lower(i) = 
    diag(i) = 
    upper(i) = 
    rhs(i) = 
end
% define the last equation (BC)
lower(n+1) = 
diag(n+1) =
rhs(n+1) = 

% solve system of linear equations with 3-diagonal matrix:
y = tridiag(lower, diag, upper, rhs);

figure;
plot (x,y);
xlabel('x');
ylabel('y(x)');
