It sounds to me like you don't. If they enter a number greater than ten then clearly it wont fit in a 10 by 10 matrix and so an error should be given.

I'd use an if-statement to check the entered...