Damith,
By including the indices in the variable names, you end up with a lot of places where you need to build up strings for evaluation and then call eval.
Have you reconsidered your need about why you need to have 39 different variables as is the recommended way of avoiding calling eval: http://www.mathworks.com/help/matlab/matlab_prog/string-evaluation.html
Best,
Narfi