close all % closes all windows opened during the previous runs clear all % clears the memory from the results of previous runs clc % clears screen nx= % THE NUMBER OF POINTS IN X DIRECTION dx= % DISCRETISATION STEP x= % X-COORDINATES OF GRID POINTS kap= % THERMAL DIFFUSIVITY dt= % OPTIMAL TIME STEP t= % INITIAL TIME tend= % FINAL TIME u0= % INITIAL CONDITION u=u0; % MEMORY ALLOCATION FOR THE SOLUTION AT THE NEXT TIME STEP alp=0 bet=0 it=0; plot(x,u,'r') % plots initial temperature hold on; % enables overplotting nt=50; % defines the frequency of lines on the plot while t