clear all; 
close all;

% where we solve
a = 
b = 
% final time
T = 

% spatial step
n = 
h = (b-a)/n;

% time step
m = 
k = T/m;

% grid
u = zeros(m+1,n+1);
x = a:h:b ;
t = (0:k:T)' ;

% IC
u(1,:) = 

% 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

% solve time layers one by one
for j = 1:m
    
    % 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:
    u(j+1,:) = tridiag(lower, diag, upper, rhs);
  
end

figure;
surf(x,t,u);
shading interp;
colorbar;
xlabel('x');
ylabel('t');
zlabel('u(x,t)');
title('Solution');


