UPDATE: I tried adding another for loop inside the time loop to solve for the temp change over x. It did not give me better results, but maybe I'm moving in the right direction?
for i=2:Nt+1
T_B(1,i) = T_B(1,i-1) + (h/cp)*(Tgas(i-1) - T_B(1,i-1)); %Convection boundary layer between surface and gas
for j = 2:Nx_B
depth_2D = (T_B(j-1,i-1) - 2*T_B(j,i-1) + T_B(j+1,i-1))/(dx_B^2) %use central FDM to solve d^2(T)/dx^2
time_1D = k_B*depth_2D; %dT/dt = k*d^2(T)/dx^2
T_B(j,i) = time_1D*dt + T_B(j-1,i-1);
end
T_W(1,i) = T_W(2,i) - (k_B/k_W)*(T_B(end,i) - T_B(end-1,i)); %Conduction into boundary for barrier is equal to conduction out of boundary for wall
%depth_2D = (T_W(1:end-2,i)-2*T_W(2:end-1,i)+T_W(3:end,i))/dx_W^2;
%time_1D = k_W*depth_2D;
%T_W(2:end-1,i) = time_1D*dt + T_W(2:end-1,i-1);
%T_W(end,i) = 300;
end