rania - what is the code that you have written that is generating this error message? If there are not too many lines then please paste the formatted code into your question, else attach it using the paperclip button. Also, please include the line number from the code that is generating the error.
The error message index exceeds matrix dimension usually means that the code is trying to access an element in a matrix with an index value that is larger than particular dimension.