I'm exploring the AGC module of Communication, however the script does not execute as good as the Simulink models for some reason. I'm testing it with a about 25 times scaled 16-QAM constellation. Injecting the same input to Simulink block and and Matlab script yield 2 different results, that the result from Simulink is far better than Matlab script as following:
Up: from Simulink, Down: from sciprt.
I adjust every properties the same between 2 models. The constellation of Simulink output is draw by:
scatterplot(out.new_agc.Data(:,:,end));
My respective code and Simulink model can be found attached. It's really strange to me, my guess is that AGC module reuse some properties from previous loops, but it's not yet available in my code.