According to me, if you are extracting the text from the image and than calculating the frequency then Matlab is recommended.
But if you are processing the text file then there many other programming languages, platforms and frameworks that easily process the text files. And coding in those tools will be simpler if you work on Unicode of the Arabic characters.
I think R Programming will make it easier for you as it is more recommended for statistical computations..
Thanks for your answers, firstly I start programming by R but Unicode of Arabic is very complex in R. So Matlab R2018a adding a toolbox for text analytic with easy Unicode for reading a Arabic text. I think there is exist a matlab commands for computing a list of words in one run like in English text..