Speeding up loop-rich Matlab function to calculate temperature distribution
First, using vectors would probably speed it up quite much, and would be worth the effort.

However, here's a small tip, that could improve the performance a little bit:

In many of the CPU-hungry iterative computations, you could replace the computations that occur several times by a variable. 

In the code, there are several "j+i" terms. They can simply be replaced by a variable named, "jpi". So, the number of additions in each value of j would decrease by 5 (not 6, as you still need to do an addition, once per each iteration of j).

dis(j) is also frequently used, and it might be useful to create another dummy variable, like dis_j = dis(j) once per each iteration of j. I don't know if matlab compiler does this itself to optimize performance. this one stops the cpu from looking at the value of dis(j) each time it is called. So it should help a little bit.