Led matrix brightness problem

If that array index was not in your code, it would have been a problem. But it was in your code, and when you posted your code without tags, it was missing, so it was not really a problem. The lesson here is the importance of using code tags, otherwise time can be wasted on problems that are not really problems. I hope you understand now.