Matlab simulation about Rayleigh