There is no mention that the communications toolbox is required. The files will not run as-is, for MATLAB doesn't recognize filenames which begin with a number. Rename the files! Also, why use scripts? Finally, please pre-allocate your variables instead of growing them in a FOR loop. This makes your code unbearably slow.
@Paul: Thanks for the comment. Sure, I can add link to your code (with credits) in www.dsplog.com.
However, I would like to understand the equation prior. For a general M-QAM (M-even), the symbol error rate has an erfc() term and erfc^2() term.
And for ber, I just took the first term. Given the above understanding, I was unable to understand the equation which you have suggested. How have you converted the erfc^2() term to two erfc() terms? Kindly point me to a reference, if possible.
Thanks in advance.