It calculates the mean-squared error (MSE) between the arrays X(transmitted data) and Y(received data). X and Y can be arrays of any dimension, but must be of the same size and class.
To plot MSE vs SNR, then use in linear scale use: plot (snr_lin, err);
calculate the SNR in linear scale as snr_lin to plot. Please ask specifically for more details.