Finished thermal MATLAB code.