In this file there are two m-files.One is function and other is program. So during running the program save both file in same folder.First open the function rect ,then and run the ber_QAM file. You will get the required result.
Here simulation is performed for 10,000 symbols in the presence of
additive Gaussian noise at different values of SNR.